I have playbook that I've been hacking on for a year and it works OK, but I know it's not great, part of it runs ansible on the target machine with a "command" task. Because of that, I don't see the output of this task in my ansible playbook.
I need to run this play in the middle of the playbook because it is dependent on a prior task and a subsequent task depends on it (otherwise I'd break it up differently)
I'd like to be able to see the output of all my plays, is there a better way to branch off plays in the middle of a play.
For instance: given a playbook running on HOST_A and HOST_B at TASK 3, suspend running plays, run next plays on HOST_C and HOST_D then HOST_E and HOST_F?
- name: update other machines
command: "/usr/bin/ansible-playbook /etc/ansible/playbooks/other-machines.yml -e 'ansible_user={{ item.ansible_user }}' -l {{ item.ansible_hostname }}"
with_items: "{{ other_machine_connections }}"
ansible
include-m command -s 'some commands'
, i.e. you aren't actually running a playbook? In your last example, is it one play for HOST_A and HOST_B, then runansible
command on HOST_C and HOST_D, then final play on HOST_E and HOST_F? Examples of the plays and commands would help a lot, even if you include dummy code, to understand structure.ansible-playbook
instead of justansible