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




On Monday, 15 October 2018 18:26:54 UTC+8, Jonathan Lozada De La Matta 
wrote:
>
> did you add the inventory to etc/ansible/hosts?
>
> On Mon, Oct 15, 2018 at 12:52 AM Ronnie10 <[email protected] <javascript:>> 
> wrote:
>
>> 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,
>>
>> -- 
>> 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 [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/d5fe5b68-03a9-4e37-a2ed-1c90a8147fad%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/ansible-project/d5fe5b68-03a9-4e37-a2ed-1c90a8147fad%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> -- 
>
> Jonathan lozada de la matta
>
> AUTOMATION PRACTICE
>
>
>  
>
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f4860991-2e3d-40de-92eb-c197426f57db%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to