September 2018
Beginner to intermediate
214 pages
5h 53m
English
Ansible offers the option of ignoring some task errors when they are reported. This is because Ansible by default halts a playbook if one of its tasks has failed. Sometimes, if a task is used to execute an optional job or to test a particular aspect of the system, the task isn't important enough to cause the entire playbook to halt. We tend to add the ignore_errors: yes option at the end of these tasks, but this is a very bad habit that may cause damage to your hosts, especially in pipelined tasks.
The best way to deal with optional tasks or those that return an error even when they have executed what is needed is to use the failed_when and changed_when options to define when a task has failed or performed ...
Read now
Unlock full access