FATAL: all hosts have already failed -- aborting

1,009 views
Skip to first unread message

Marc Petrivelli

unread,
Apr 4, 2014, 12:02:21 PM4/4/14
to ansible...@googlegroups.com
I am getting

FATAL: all hosts have already failed -- aborting 

even though none of the hosts are showing any errors.   This problem starting creeping up in the 1.5.x releases. Any ideas?

Michael DeHaan

unread,
Apr 4, 2014, 2:10:12 PM4/4/14
to ansible...@googlegroups.com
Without more context, it's impossible to tell what you mean, as this is exactly the message you get after all the hosts have had failures.

Please supply some more context about your playbook run, execution, and so on, and we can discuss further.


--
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/e171e42f-d802-444e-a74c-79ad02d93a5c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Marc Petrivelli

unread,
Apr 4, 2014, 3:51:41 PM4/4/14
to ansible...@googlegroups.com
This is an interesting side effect of using local tasks vs plays with hosts: 127.0.0.1.

In my case I was running a playbook and on the command line limiting with -l command.

ansible-playbook -l host1 site.yml

in the play book I had the following play:

 hosts: localhost
  user
: root
  tasks
:
 
- file: path="tmp/file1.txt" state=absent
 
- file: path="tmp/file2.txt" state=absent


The plays in the playbook all finished successfully however at the end I got the error listed in the subject of this post: FATAL: all hosts have already failed -- aborting.

Looking at the source (lib/ansible/callbacks.py and lib/ansible/playbook/__init__.py) this error seems to be spit out when (but not only when) the the expected play_count/host_count minus the actual play_count/host_count is greater than the max fail pct (in my case 0).

I figured that having an explicit play with localhost might be confusing the counts.  So I changed my code to:

- hosts: dhcp_servers
  user
: root
  tasks
:
 
- local_action: file path="tmp/file1.txt" state=absent
 
- local_action: file path="tmp/file2.txt" state=absent

The FATAL at the end of the run disappeared.  Not sure if it matters but in my inventory file I do have this line:

localhost ansible_ssh_host=127.0.0.1 ansible_connection=local


Something doesn't seem right here.

Michael DeHaan

unread,
Apr 4, 2014, 9:55:29 PM4/4/14
to ansible...@googlegroups.com
It could very well be that the "implicit localhost" magic doesn't sit well with the failure percentage code -- please make sure we have a github ticket on this one with details of how to repro.

Thanks!


Reply all
Reply to author
Forward
0 new messages