Thanks, You are right.  At first, I just created a ansible.cfg in my work 
dir to add some custom configuration in.
When I found this problem, I thouth it would be someting wrong in my 
ansible.cfg. So I tested it  by commented  lines one by one.
After all lines are commnted,  the problem was still there with an empty 
ansible.cfg file :)

在 2015年7月13日星期一 UTC+8下午10:34:25,Serge van Ginderachter写道:
>
> Ansible needs a well configured ansible.cfg to work reliably. I don't 
> think it will fallback on defaults for everything it needs.
> At least the inventory needs to be set properly.
>
> If  there is one in the current directory, it will use that, so if you 
> make that empty, it will just miss a lot of settings it needs.
>
> What is your point by creating an empty ansible.cfg? 
>
> On 13 July 2015 at 08:05, Oliver markey <[email protected] <javascript:>> 
> wrote:
>
>> I create a simple playbook to restart rsyslog using service module.
>>
>> ---
>> - hosts: remote
>>   remote_user: root
>>   gather_facts: true
>>
>>   tasks:
>>     - name: restart rsyslog
>>       service: name=rsyslog state=restarted
>>       sudo: yes
>>       sudo_user:root
>>
>> After I touched an empty ansible.cfg in current directory,
>> I executed  ansible-playbook rsyslog.yml --ask-become-pass  and it 
>> returned a failed message
>>
>> failed: [127.0.0.1] => {"failed": true}
>> FATAL: all hosts have already failed -- aborting
>>
>> But when I remove ansible.cfg ,  rsyslog was restarted normally.
>>
>> If I changed rsyslog to nginx or mysql , thare was no such problem.
>>
>> Anyone got a clue ??
>>
>> -- 
>> 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/9c4a8e25-4acb-41ad-bbd9-a0f1496095f7%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/ansible-project/9c4a8e25-4acb-41ad-bbd9-a0f1496095f7%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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/a2e3a130-b59c-4fb9-b850-5e0f5acfb608%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to