Add some details to any_errors_fatal documentation (#62029)

This commit is contained in:
Sloane Hertel 2019-09-12 16:15:02 -04:00 committed by Sandra McCann
parent 0e72cbd451
commit 09f1c286e0
2 changed files with 8 additions and 2 deletions

View file

@ -312,7 +312,7 @@ use the default remote connection type::
Interrupt execution on any error
````````````````````````````````
With the ''any_errors_fatal'' option, any failure on any host in a multi-host play will be treated as fatal and Ansible will exit immediately without waiting for the other hosts.
With the ''any_errors_fatal'' option, any failure on any host in a multi-host play will be treated as fatal and Ansible will exit as soon as all hosts in the current batch have finished the fatal task. Subsequent tasks and plays will not be executed. You can recover from what would be a fatal error by adding a rescue section to the block.
Sometimes ''serial'' execution is unsuitable; the number of hosts is unpredictable (because of dynamic inventory) and speed is crucial (simultaneous execution is required), but all tasks must be 100% successful to continue playbook execution.

View file

@ -152,13 +152,19 @@ Aborting the play
Sometimes it's desirable to abort the entire play on failure, not just skip remaining tasks for a host.
The ``any_errors_fatal`` play option will end the play when any tasks results in an error and stop execution of the play::
The ``any_errors_fatal`` option will end the play and prevent any subsequent plays from running. When an error is encountered, all hosts in the current batch are given the opportunity to finish the fatal task and then the execution of the play stops. ``any_errors_fatal`` can be set at the play or block level::
- hosts: somehosts
any_errors_fatal: true
roles:
- myrole
- hosts: somehosts
tasks:
- block:
- include_tasks: mytasks.yml
any_errors_fatal: true
for finer-grained control ``max_fail_percentage`` can be used to abort the run after a given percentage of hosts has failed.
Using blocks