Unfortunately, no. Here’s my playbook:

[maltfield@localhost altfield]$ cat ansible/uptime.yml
---
- hosts: "{{ roles }}"
  max_fail_percentage: "{{ max_fail_percentage }}"
  serial: "{{ serial }}"
  sudo: yes
  tasks:
  - name: get uptime
    shell: "uptime"

And here’s extra_vars:

{'version': '8a4734e88fec756f44a3e0a9bf8d9ed293ec0a8c', 'roles': 
'altfield-staging-rollingupdate', 'max_fail_percentage': 50, 'env': 'staging', 
'serial': 2}

Is it possible this "local" issue is being defaulted to in some other way? How 
do I verify the value of "connection"? TIA!

From: [email protected] 
[mailto:[email protected]] On Behalf Of Marc Petrivelli
Sent: Tuesday, April 08, 2014 20:05
To: [email protected]
Subject: [ansible-project] Re: FATAL execution without any failures?

Any chance you have any local plays in your playbook?  something like 

- hosts: 127.0.0.1 
  connection: local


On Monday, April 7, 2014 11:02:05 PM UTC-4, maltfield wrote:
Hi ansible gurus!
 
I’m writing a python script that uses ansible.playbook to do a rolling update, 
but I’m very confused by the following output at the end of my execution:
 
FATAL: all hosts have already failed -- aborting
{'unreachable': 0, 'skipped': 0, 'ok': 2, 'changed': 1, 'failures': 0}
{'unreachable': 0, 'skipped': 0, 'ok': 2, 'changed': 1, 'failures': 0}
{'unreachable': 0, 'skipped': 0, 'ok': 2, 'changed': 1, 'failures': 0}
 
The “FATAL: all hosts have already failed – aborting” message was printed by 
run() in
 
pb = ansible.playbook.PlayBook(…)
pb.run()
 
And I printed the last 3 lines with:
 
  hosts = sorted(pb.stats.processed.keys())                                   
   #display(callbacks.banner("PLAY RECAP"))
   playbook_cb.on_stats(pb.stats)
 
   for h in hosts:
      t =pb.stats.summarize(h)
      if t['failures'] > 0:
         failed_hosts.append(h)
      if t['unreachable'] > 0:
         unreachable_hosts.append(h)
 
      print t
 
Can someone please explain to me why I’m getting a FATAL error message after 
ansible successfully executed on 3 nodes (3x ‘ok’ messages).
 
More info:
 
I have serial=2 and max_fail_percent=50
 
[maltfield@localhost altfield]$ ansible --version
ansible 1.5
[maltfield@ localhost altfield]$ uname -a
Linux zce-admin-02 2.6.32-220.23.1.el6.x86_64 #1 SMP Mon Jun 18 18:58:52 BST 
2012 x86_64 x86_64 x86_64 GNU/Linux
 
Thank you,
Michael Altfield
-- 
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/6e08885c-4426-4945-a275-08c01ceaa020%40googlegroups.com.
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/9BF103467479BB46AE6BC67DC58DE4DF9405CBD2%40C7-EX-MAIL01.corp.zynga.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to