March 2019
Intermediate to advanced
412 pages
9h 49m
English
This setting instructs Ansible to consider the entire operation fatal, and to stop executing immediately if any host encounters an error. To demonstrate this, we'll add a new group to our mastery-hosts inventory, using a pattern that will expand up to 10 new hosts:
[failtest] failer[01:10]
Then, we'll create a play on this group with any_errors_fatal set to true. We'll also turn off fact gathering, since these hosts do not exist:
--- - name: any errors fatal hosts: failtest gather_facts: false any_errors_fatal: true
We want a task that will fail for one of the hosts, but not the others. Then, we'll want a second task as well, just to demonstrate how it will not run:
tasks: - name: fail last host fail: msg: "I ...
Read now
Unlock full access