ansible_play_batch equivalant which excludes failed hosts?

239 views
Skip to first unread message

Cody John

unread,
Nov 23, 2016, 1:42:53 PM11/23/16
to Ansible Project
I'm using pause with a prompt to display a list of devices that the current role is about to applied to.  Here's an example:

- name: Prompting To Continue
  pause
:
    prompt
: >

     
#################################################################################################
     
       
Proceed with OSPF cost out?  Enter to continue, Ctrl-c to abort.


     
{{ ansible_play_batch | sort | to_nice_yaml }}
     
     
#################################################################################################
 
when: enable_change_prompts

The problem is, if a host failed earlier in the playbook before this role was assigned, the following tasks will not be applied to it but it is still part of ansible_play_batch so it still shows up in the prompt.  Any ideas on how to get the equivalant of ansible_play_batch minus any failed hosts?

Brian Coca

unread,
Nov 23, 2016, 1:49:10 PM11/23/16
to ansible...@googlegroups.com
That was a bug and should be fixed in current devel, ansible_play_batch and ansible_play_hosts should only reflect 'current' hosts.


----------
Brian Coca

Cody John

unread,
Nov 23, 2016, 2:03:29 PM11/23/16
to Ansible Project
Thanks Brian!
Reply all
Reply to author
Forward
0 new messages