Digging into playbook execution problems
There are cases where an Ansible execution will interrupt. Many things can cause these situations.
The network is the most frequent cause of problems I’ve found while executing Ansible playbooks. Since the machine issuing the commands and the one performing them are usually linked through the network, a problem in the network will immediately show itself as an Ansible execution problem.
You can tell Ansible to repeat the execution of a task by registering a variable and using the until
keyword.
Sometimes, and this is particularly true for some modules, such as ansible.builtin.shell
or ansible.builtin.command
, the return code is non-zero, even though the execution was successful. In those cases, you can ignore the error by using the following line in your module:
ignore_errors: yes
For instance, if you run the /bin/false
command, it will always return 1
. To execute this in a playbook so that you can avoid it blocking there...