March 2019
Intermediate to advanced
412 pages
9h 49m
English
A task condition, named ignore_errors, is used to ignore errors. This condition is a Boolean, meaning that the value should be something Ansible understands to be true, such as yes, on, true, or 1 (string or integer).
To demonstrate how to use ignore_errors, let's create a playbook where we attempt to query a web server that doesn't exist. Typically, this would be an error, and if we don't define ignore_errors, we get the default behavior, that is, the host will be marked as failed and no further tasks will be attempted on that host. Create a new playbook called error.yaml as follows to look further at this behavior:
---- name: error handling hosts: localhost gather_facts: false tasks: - name: broken website uri: url: http://notahost.nodomain ...
Read now
Unlock full access