# not able to install program

**URL:** <https://forum.ansible.com/t/not-able-to-install-program/28787>\
**Category:** Ansible Project\
**Created:** [October 15, 2018, 4:52am UTC](https://forum.ansible.com/t/not-able-to-install-program/28787 "2018-10-15T04:52:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ronnie10](https://avatars.discourse-cdn.com/v4/letter/r/d78d45/32.png) [@Ronnie10](https://forum.ansible.com/u/Ronnie10)\
**Post date:** [October 15, 2018, 4:52am UTC](https://forum.ansible.com/t/not-able-to-install-program/28787/1 "2018-10-15T04:52:06Z")

</div>

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](http://web.test.com)]

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

[web.test.com](http://web.test.com) : ok=1 changed=0 unreachable=0 failed=0

Anything I have missed out?

My task main.yml as follow:

---

<div class="post-metadata">

**Author:** ![Jonathan\_Lozada\_De\_L](https://avatars.discourse-cdn.com/v4/letter/j/eb8c5e/32.png) [@Jonathan\_Lozada\_De\_L](https://forum.ansible.com/u/Jonathan_Lozada_De_L)\
**Post date:** [October 15, 2018, 10:26am UTC](https://forum.ansible.com/t/not-able-to-install-program/28787/2 "2018-10-15T10:26:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Ronnie10](https://avatars.discourse-cdn.com/v4/letter/r/d78d45/32.png) [@Ronnie10](https://forum.ansible.com/u/Ronnie10)\
**Post date:** [October 16, 2018, 1:45am UTC](https://forum.ansible.com/t/not-able-to-install-program/28787/3 "2018-10-16T01:45:12Z")

</div>

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:

---

<div class="post-metadata">

**Author:** ![Jonathan\_Lozada\_De\_L](https://avatars.discourse-cdn.com/v4/letter/j/eb8c5e/32.png) [@Jonathan\_Lozada\_De\_L](https://forum.ansible.com/u/Jonathan_Lozada_De_L)\
**Post date:** [October 16, 2018, 1:22pm UTC](https://forum.ansible.com/t/not-able-to-install-program/28787/4 "2018-10-16T13:22:08Z")

</div>

did you check [https://docs.ansible.com/ansible/latest/user\_guide/become.html](https://docs.ansible.com/ansible/latest/user_guide/become.html) ?
