not able to install program

Hi there,

I am new to ansible, and trying to install httpd using ansible in my test setup.

My control machine is Mac, the test server is Centos, I have created user with passwordless sudo right.

When I try to run my playbook ansible-playbook playbook.yml I always get the following result:

$ansible-playbook playbook.yml

PLAY [all] *************************************************************************************************************************

TASK [Gathering Facts] *************************************************************************************************************

ok: [web.test.com]

PLAY RECAP *************************************************************************************************************************

web.test.com : ok=1 changed=0 unreachable=0 failed=0

Anything I have missed out?

My task main.yml as follow:

did you add the inventory to etc/ansible/hosts?

Hi Jonathan,

Yes I have added inventory, I can do ping with ansible without any issue.

After trying, I notice it has to be passwordless sudo user then only I can run adhoc ansible command such as $ansible all -a ‘sudo yum install git -y’, or create a playbook with the following content:

did you check https://docs.ansible.com/ansible/latest/user_guide/become.html ?