Aborting on the first error: any_errors_fatal
If you setany_errors_fataland a task returns an error, Ansible finishes the fatal task on all hosts in the current batch and then stops executing the play on all hosts. Subsequent tasks and plays are not executed. You can recover from fatal errors by adding arescue sectionto the block. You can setany_errors_fatalat the play or block level.
You can use this feature when all tasks must be 100% successful to continue playbook execution. For example, if you run a service on machines in multiple data centers with load balancers to pass traffic from users to the service, you want all load balancers to be disabled before you stop the service for maintenance. To ensure that any failure in the task that disables the load balancers will stop all other tasks:
In this example, Ansible starts the software upgrade on the front ends only if all of the load balancers are successfully disabled.