not able to install program

34 views
Skip to first unread message

Ronnie10

unread,
Oct 15, 2018, 12:52:06 AM10/15/18
to Ansible Project
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:

---

-hosts: all

 tasks:

 - name: Installing Httpd

   yum: 

    name:

       - httpd

    state:latest


Thank you,

Jonathan Lozada De La Matta

unread,
Oct 15, 2018, 6:26:54 AM10/15/18
to ansible...@googlegroups.com
did you add the inventory to etc/ansible/hosts?

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/d5fe5b68-03a9-4e37-a2ed-1c90a8147fad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

Jonathan lozada de la matta

AUTOMATION PRACTICE



 

Ronnie10

unread,
Oct 15, 2018, 9:45:12 PM10/15/18
to Ansible Project
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:

---

- hosts: all

  tasks:

  - name: install http

    shell: sudo yum install httpd -y


If I use sudo with password, then it won't work.


Thanks,


Ronnie10



Jonathan Lozada De La Matta

unread,
Oct 16, 2018, 9:22:30 AM10/16/18
to ansible...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages