I have a playbook with multiple plays, where each play is executed on a different group of hosts. The behavior that I’m looking for is that if any host in any group is unreachable, the whole playbook fails immediately.
Below is a small repro of the behavior I’m seeing. Using any_errors_fatal, I’m able to prevent any steps in the first play from running if any of the hosts in the group are inaccessible. However, since all of the hosts in the second play are accessible, that play still runs.
Is there a way that I can get the playbook run to fail out as soon as the first play fails?
executing with
`
ansible-playbook playbook-test-unreachable-fatal.yml -i inventory
`
inventory:
`
[just_good_host]
localhost ansible_connection=local
[good_and_bad_hosts]
localhost ansible_connection=local
not.a.real.host.com
`
playbook-test-unreachable-fatal.yml:
`
(attachments)
inventory (130 Bytes)
playbook-test-unreachable-fatal.yml (941 Bytes)