ansible/docs/docsite/rst/user_guide/playbooks_error_handling.rst

201 lines
7.5 KiB
ReStructuredText
Raw Normal View History

2013-09-29 23:10:28 +00:00
Error Handling In Playbooks
===========================
2012-05-13 15:00:02 +00:00
.. contents:: Topics
2013-10-03 02:03:15 +00:00
Ansible normally has defaults that make sure to check the return codes of commands and modules and
it fails fast -- forcing an error to be dealt with unless you decide otherwise.
2013-11-16 22:01:26 +00:00
2017-01-14 01:55:19 +00:00
Sometimes a command that returns different than 0 isn't an error. Sometimes a command might not always
need to report that it 'changed' the remote system. This section describes how to change
the default behavior of Ansible for certain tasks so output and error handling behavior is
as desired.
.. _ignoring_failed_commands:
Ignoring Failed Commands
````````````````````````
Generally playbooks will stop executing any more steps on a host that has a task fail.
Sometimes, though, you want to continue on. To do so, write a task that looks like this::
- name: this will not be counted as a failure
2013-07-15 17:50:48 +00:00
command: /bin/false
ignore_errors: yes
2015-10-27 18:29:37 +00:00
Note that the above system only governs the return value of failure of the particular task,
so if you have an undefined variable used or a syntax error, it will still raise an error that users will need to address.
Note that this will not prevent failures on connection or execution issues.
This feature only works when the task must be able to run and return a value of 'failed'.
.. _resetting_unreachable:
Resetting Unreachable Hosts
```````````````````````````
.. versionadded:: 2.2
Connection failures set hosts as 'UNREACHABLE', which will remove them from the list of active hosts for the run.
To recover from these issues you can use `meta: clear_host_errors` to have all currently flagged hosts reactivated,
so subsequent tasks can try to use them again.
2015-10-27 18:29:37 +00:00
2014-02-15 19:05:42 +00:00
.. _handlers_and_failure:
Handlers and Failure
````````````````````
When a task fails on a host, handlers which were previously notified
will *not* be run on that host. This can lead to cases where an unrelated failure
can leave a host in an unexpected state. For example, a task could update
a configuration file and notify a handler to restart some service. If a
task later on in the same play fails, the service will not be restarted despite
the configuration change.
You can change this behavior with the ``--force-handlers`` command-line option,
or by including ``force_handlers: True`` in a play, or ``force_handlers = True``
in ansible.cfg. When handlers are forced, they will run when notified even
if a task fails on that host. (Note that certain errors could still prevent
the handler from running, such as a host becoming unreachable.)
2013-10-12 15:20:56 +00:00
.. _controlling_what_defines_failure:
2013-10-12 14:51:32 +00:00
Controlling What Defines Failure
````````````````````````````````
Backport/2.8/docs rst omnibus (#56310) * Update windows_setup.rst (#55535): Wrong protocol and port in command. (cherry picked from commit 6ea3eca8ffa6a648243f3d6bf068bd5705e1db47) * Clarify the two targets of vault encryption, with notes about advantages and drawbacks of each Co-Authored-By: tacatac <taca@kadisius.eu> (cherry picked from commit 79198cad7a5d43e4c4e9adf6b04b3106e332399b) * Improve consistency of loop documentation (#55674) (cherry picked from commit a5cb47d6975c8e324249085934e698997ed4cc72) * Add Microsoft Document URL for WinRM Memory Hotfix (#55680) Co-Authored-By: hiyokotaisa <thel.vadam2485@gmail.com> (cherry picked from commit 7b86208fcd85b327a357d65c083e1ac582185ddf) * Clarify the documentation for `async` and `poll`; describe the behavior when `poll` = 0 and when it does not. Co-Authored-By: tacatac <taca@kadisius.eu> (cherry picked from commit dbc64ae64cb50d25855efe8b55487f66d4c82191) * Add security group info and example to AWS guide (#55783): expand documentation on how to use lookup plugin aws_service_ip_ranges with ec2_group module (cherry picked from commit bb5059f2c7d688fae041ca38af15da1c7c4cf2c7) * correct description of modules vs plugins (#55784) (cherry picked from commit 9d5b5d7ddd161e7996baf0b5bb48a22153a8a7e8) * Fix var naming (#55795): Make vars match tasks in Google Compute guide. (cherry picked from commit 943f7334c54ffe26454644ebdce5317e29e84ac4) * Clarifies how Ansible processes multiple `failed_when` conditions (#55941): multiple failed_when conditions join with AND not OR to counter third-party pages online incorrectly stating that it uses `OR`. ([example](https://groups.google.com/d/msg/ansible-project/cIaQTmY3ZLE/c5w8rlmdHWIJ)). (cherry picked from commit 5439eb8bd832a70aa5dc3a675585f38663faa753) * Docs: edits & expands module_utils & search path info in dev guide (#55931) (cherry picked from commit 8542459b959366964818025482a24c6602655d1c) * Add faq note about ssh ServerAliveInterval (#55568) (cherry picked from commit 76dba7aa4f5fa2dfd561add2771d7b8d123bdbf1) * docsite: correct path, list requirements for testing module docs, etc. (#52008) * dev_guide: correct path, list requirements, etc.; module HTML docs are in '_build/html/module' subdir (cherry picked from commit b14f477bee403f62811bf1ade93aadd1913cdf5b) * Developer documentation update involving module invocation (#55747) * Update docs for the 2.7 change to AnsiballZ which invokes modules with one less Python interpreter * Add a section on how module results are returned and on trust between modules, action plugins, and the executor. * Update docs/docsite/rst/dev_guide/developing_program_flow_modules.rst Co-Authored-By: abadger <a.badger@gmail.com> (cherry picked from commit edafa71f424345f26cd85d348b876839837a8177) * add doc example of multiline failed_when with OR (#56007) * add variety to multiple OR failed_when doc example (cherry picked from commit 7d5ada71616af96ceec7295aa089009c0ad12f92) * Note that by default the regex test is identical to match, but can do much more (#50205) * Note that the regex test behaves like 'match', with default settings (cherry picked from commit 86e98c521307fc929b1c27180e6a697ebf4a459d) * more info on how vaults work (#56183) also add warning about what it covers. (cherry picked from commit 8ff27c4e0c8cb34acfa04566bbc676c943a37a87) * Fix var naming in GCE guide (cherry picked from commit dae5564e2b9f5c3cc8782dc6cac57e9402859f8d) * dev_guide: Various small updates (#53273) * Document the clarifications that I usually remark when doing reviews * Update docs/docsite/rst/dev_guide/developing_modules_documenting.rst Co-Authored-By: dagwieers <dag@wieers.com> (cherry picked from commit eac7f1fb584a9689a2acbc15a17c7bbd37acf690) * Lack of "--update" flag in older Ubuntu distros (#56283): when installing on older Ubuntu distributions be aware of the lack of ``-u`` or ``--update`` flag. (cherry picked from commit dd0b0ae47b3e01ca45691ab19accbf74b38540c4) * should have gone into 52373 (#56306) (cherry picked from commit 3c8d8b150965600b50695e77fa8ffb73463b8f6a)
2019-05-13 13:22:20 +00:00
Ansible lets you define what "failure" means in each task using the ``failed_when`` conditional. As with all conditionals in Ansible, lists of multiple ``failed_when`` conditions are joined with an implicit ``and``, meaning the task only fails when *all* conditions are met. If you want to trigger a failure when any of the conditions is met, you must define the conditions in a string with an explicit ``or`` operator.
2013-10-12 14:51:32 +00:00
Backport/2.8/docs rst omnibus (#56310) * Update windows_setup.rst (#55535): Wrong protocol and port in command. (cherry picked from commit 6ea3eca8ffa6a648243f3d6bf068bd5705e1db47) * Clarify the two targets of vault encryption, with notes about advantages and drawbacks of each Co-Authored-By: tacatac <taca@kadisius.eu> (cherry picked from commit 79198cad7a5d43e4c4e9adf6b04b3106e332399b) * Improve consistency of loop documentation (#55674) (cherry picked from commit a5cb47d6975c8e324249085934e698997ed4cc72) * Add Microsoft Document URL for WinRM Memory Hotfix (#55680) Co-Authored-By: hiyokotaisa <thel.vadam2485@gmail.com> (cherry picked from commit 7b86208fcd85b327a357d65c083e1ac582185ddf) * Clarify the documentation for `async` and `poll`; describe the behavior when `poll` = 0 and when it does not. Co-Authored-By: tacatac <taca@kadisius.eu> (cherry picked from commit dbc64ae64cb50d25855efe8b55487f66d4c82191) * Add security group info and example to AWS guide (#55783): expand documentation on how to use lookup plugin aws_service_ip_ranges with ec2_group module (cherry picked from commit bb5059f2c7d688fae041ca38af15da1c7c4cf2c7) * correct description of modules vs plugins (#55784) (cherry picked from commit 9d5b5d7ddd161e7996baf0b5bb48a22153a8a7e8) * Fix var naming (#55795): Make vars match tasks in Google Compute guide. (cherry picked from commit 943f7334c54ffe26454644ebdce5317e29e84ac4) * Clarifies how Ansible processes multiple `failed_when` conditions (#55941): multiple failed_when conditions join with AND not OR to counter third-party pages online incorrectly stating that it uses `OR`. ([example](https://groups.google.com/d/msg/ansible-project/cIaQTmY3ZLE/c5w8rlmdHWIJ)). (cherry picked from commit 5439eb8bd832a70aa5dc3a675585f38663faa753) * Docs: edits & expands module_utils & search path info in dev guide (#55931) (cherry picked from commit 8542459b959366964818025482a24c6602655d1c) * Add faq note about ssh ServerAliveInterval (#55568) (cherry picked from commit 76dba7aa4f5fa2dfd561add2771d7b8d123bdbf1) * docsite: correct path, list requirements for testing module docs, etc. (#52008) * dev_guide: correct path, list requirements, etc.; module HTML docs are in '_build/html/module' subdir (cherry picked from commit b14f477bee403f62811bf1ade93aadd1913cdf5b) * Developer documentation update involving module invocation (#55747) * Update docs for the 2.7 change to AnsiballZ which invokes modules with one less Python interpreter * Add a section on how module results are returned and on trust between modules, action plugins, and the executor. * Update docs/docsite/rst/dev_guide/developing_program_flow_modules.rst Co-Authored-By: abadger <a.badger@gmail.com> (cherry picked from commit edafa71f424345f26cd85d348b876839837a8177) * add doc example of multiline failed_when with OR (#56007) * add variety to multiple OR failed_when doc example (cherry picked from commit 7d5ada71616af96ceec7295aa089009c0ad12f92) * Note that by default the regex test is identical to match, but can do much more (#50205) * Note that the regex test behaves like 'match', with default settings (cherry picked from commit 86e98c521307fc929b1c27180e6a697ebf4a459d) * more info on how vaults work (#56183) also add warning about what it covers. (cherry picked from commit 8ff27c4e0c8cb34acfa04566bbc676c943a37a87) * Fix var naming in GCE guide (cherry picked from commit dae5564e2b9f5c3cc8782dc6cac57e9402859f8d) * dev_guide: Various small updates (#53273) * Document the clarifications that I usually remark when doing reviews * Update docs/docsite/rst/dev_guide/developing_modules_documenting.rst Co-Authored-By: dagwieers <dag@wieers.com> (cherry picked from commit eac7f1fb584a9689a2acbc15a17c7bbd37acf690) * Lack of "--update" flag in older Ubuntu distros (#56283): when installing on older Ubuntu distributions be aware of the lack of ``-u`` or ``--update`` flag. (cherry picked from commit dd0b0ae47b3e01ca45691ab19accbf74b38540c4) * should have gone into 52373 (#56306) (cherry picked from commit 3c8d8b150965600b50695e77fa8ffb73463b8f6a)
2019-05-13 13:22:20 +00:00
You may check for failure by searching for a word or phrase in the output of a command::
2013-10-12 14:51:32 +00:00
- name: Fail task when the command error output prints FAILED
2013-10-12 14:51:32 +00:00
command: /usr/bin/example-command -x -y -z
register: command_result
failed_when: "'FAILED' in command_result.stderr"
or based on the return code::
- name: Fail task when both files are identical
raw: diff foo/file1 bar/file2
register: diff_cmd
failed_when: diff_cmd.rc == 0 or diff_cmd.rc >= 2
In previous version of Ansible, this can still be accomplished as follows::
2013-10-12 14:51:32 +00:00
- name: this command prints FAILED when it fails
command: /usr/bin/example-command -x -y -z
register: command_result
ignore_errors: True
- name: fail the play if the previous command did not succeed
fail:
msg: "the command failed"
2013-10-12 14:51:32 +00:00
when: "'FAILED' in command_result.stderr"
Backport/2.8/docs rst omnibus (#56310) * Update windows_setup.rst (#55535): Wrong protocol and port in command. (cherry picked from commit 6ea3eca8ffa6a648243f3d6bf068bd5705e1db47) * Clarify the two targets of vault encryption, with notes about advantages and drawbacks of each Co-Authored-By: tacatac <taca@kadisius.eu> (cherry picked from commit 79198cad7a5d43e4c4e9adf6b04b3106e332399b) * Improve consistency of loop documentation (#55674) (cherry picked from commit a5cb47d6975c8e324249085934e698997ed4cc72) * Add Microsoft Document URL for WinRM Memory Hotfix (#55680) Co-Authored-By: hiyokotaisa <thel.vadam2485@gmail.com> (cherry picked from commit 7b86208fcd85b327a357d65c083e1ac582185ddf) * Clarify the documentation for `async` and `poll`; describe the behavior when `poll` = 0 and when it does not. Co-Authored-By: tacatac <taca@kadisius.eu> (cherry picked from commit dbc64ae64cb50d25855efe8b55487f66d4c82191) * Add security group info and example to AWS guide (#55783): expand documentation on how to use lookup plugin aws_service_ip_ranges with ec2_group module (cherry picked from commit bb5059f2c7d688fae041ca38af15da1c7c4cf2c7) * correct description of modules vs plugins (#55784) (cherry picked from commit 9d5b5d7ddd161e7996baf0b5bb48a22153a8a7e8) * Fix var naming (#55795): Make vars match tasks in Google Compute guide. (cherry picked from commit 943f7334c54ffe26454644ebdce5317e29e84ac4) * Clarifies how Ansible processes multiple `failed_when` conditions (#55941): multiple failed_when conditions join with AND not OR to counter third-party pages online incorrectly stating that it uses `OR`. ([example](https://groups.google.com/d/msg/ansible-project/cIaQTmY3ZLE/c5w8rlmdHWIJ)). (cherry picked from commit 5439eb8bd832a70aa5dc3a675585f38663faa753) * Docs: edits & expands module_utils & search path info in dev guide (#55931) (cherry picked from commit 8542459b959366964818025482a24c6602655d1c) * Add faq note about ssh ServerAliveInterval (#55568) (cherry picked from commit 76dba7aa4f5fa2dfd561add2771d7b8d123bdbf1) * docsite: correct path, list requirements for testing module docs, etc. (#52008) * dev_guide: correct path, list requirements, etc.; module HTML docs are in '_build/html/module' subdir (cherry picked from commit b14f477bee403f62811bf1ade93aadd1913cdf5b) * Developer documentation update involving module invocation (#55747) * Update docs for the 2.7 change to AnsiballZ which invokes modules with one less Python interpreter * Add a section on how module results are returned and on trust between modules, action plugins, and the executor. * Update docs/docsite/rst/dev_guide/developing_program_flow_modules.rst Co-Authored-By: abadger <a.badger@gmail.com> (cherry picked from commit edafa71f424345f26cd85d348b876839837a8177) * add doc example of multiline failed_when with OR (#56007) * add variety to multiple OR failed_when doc example (cherry picked from commit 7d5ada71616af96ceec7295aa089009c0ad12f92) * Note that by default the regex test is identical to match, but can do much more (#50205) * Note that the regex test behaves like 'match', with default settings (cherry picked from commit 86e98c521307fc929b1c27180e6a697ebf4a459d) * more info on how vaults work (#56183) also add warning about what it covers. (cherry picked from commit 8ff27c4e0c8cb34acfa04566bbc676c943a37a87) * Fix var naming in GCE guide (cherry picked from commit dae5564e2b9f5c3cc8782dc6cac57e9402859f8d) * dev_guide: Various small updates (#53273) * Document the clarifications that I usually remark when doing reviews * Update docs/docsite/rst/dev_guide/developing_modules_documenting.rst Co-Authored-By: dagwieers <dag@wieers.com> (cherry picked from commit eac7f1fb584a9689a2acbc15a17c7bbd37acf690) * Lack of "--update" flag in older Ubuntu distros (#56283): when installing on older Ubuntu distributions be aware of the lack of ``-u`` or ``--update`` flag. (cherry picked from commit dd0b0ae47b3e01ca45691ab19accbf74b38540c4) * should have gone into 52373 (#56306) (cherry picked from commit 3c8d8b150965600b50695e77fa8ffb73463b8f6a)
2019-05-13 13:22:20 +00:00
You can also combine multiple conditions for failure. This task will fail if both conditions are true::
- name: Check if a file exists in temp and fail task if it does
command: ls /tmp/this_should_not_be_here
register: result
failed_when:
- result.rc == 0
Backport/2.8/docs rst omnibus (#56310) * Update windows_setup.rst (#55535): Wrong protocol and port in command. (cherry picked from commit 6ea3eca8ffa6a648243f3d6bf068bd5705e1db47) * Clarify the two targets of vault encryption, with notes about advantages and drawbacks of each Co-Authored-By: tacatac <taca@kadisius.eu> (cherry picked from commit 79198cad7a5d43e4c4e9adf6b04b3106e332399b) * Improve consistency of loop documentation (#55674) (cherry picked from commit a5cb47d6975c8e324249085934e698997ed4cc72) * Add Microsoft Document URL for WinRM Memory Hotfix (#55680) Co-Authored-By: hiyokotaisa <thel.vadam2485@gmail.com> (cherry picked from commit 7b86208fcd85b327a357d65c083e1ac582185ddf) * Clarify the documentation for `async` and `poll`; describe the behavior when `poll` = 0 and when it does not. Co-Authored-By: tacatac <taca@kadisius.eu> (cherry picked from commit dbc64ae64cb50d25855efe8b55487f66d4c82191) * Add security group info and example to AWS guide (#55783): expand documentation on how to use lookup plugin aws_service_ip_ranges with ec2_group module (cherry picked from commit bb5059f2c7d688fae041ca38af15da1c7c4cf2c7) * correct description of modules vs plugins (#55784) (cherry picked from commit 9d5b5d7ddd161e7996baf0b5bb48a22153a8a7e8) * Fix var naming (#55795): Make vars match tasks in Google Compute guide. (cherry picked from commit 943f7334c54ffe26454644ebdce5317e29e84ac4) * Clarifies how Ansible processes multiple `failed_when` conditions (#55941): multiple failed_when conditions join with AND not OR to counter third-party pages online incorrectly stating that it uses `OR`. ([example](https://groups.google.com/d/msg/ansible-project/cIaQTmY3ZLE/c5w8rlmdHWIJ)). (cherry picked from commit 5439eb8bd832a70aa5dc3a675585f38663faa753) * Docs: edits & expands module_utils & search path info in dev guide (#55931) (cherry picked from commit 8542459b959366964818025482a24c6602655d1c) * Add faq note about ssh ServerAliveInterval (#55568) (cherry picked from commit 76dba7aa4f5fa2dfd561add2771d7b8d123bdbf1) * docsite: correct path, list requirements for testing module docs, etc. (#52008) * dev_guide: correct path, list requirements, etc.; module HTML docs are in '_build/html/module' subdir (cherry picked from commit b14f477bee403f62811bf1ade93aadd1913cdf5b) * Developer documentation update involving module invocation (#55747) * Update docs for the 2.7 change to AnsiballZ which invokes modules with one less Python interpreter * Add a section on how module results are returned and on trust between modules, action plugins, and the executor. * Update docs/docsite/rst/dev_guide/developing_program_flow_modules.rst Co-Authored-By: abadger <a.badger@gmail.com> (cherry picked from commit edafa71f424345f26cd85d348b876839837a8177) * add doc example of multiline failed_when with OR (#56007) * add variety to multiple OR failed_when doc example (cherry picked from commit 7d5ada71616af96ceec7295aa089009c0ad12f92) * Note that by default the regex test is identical to match, but can do much more (#50205) * Note that the regex test behaves like 'match', with default settings (cherry picked from commit 86e98c521307fc929b1c27180e6a697ebf4a459d) * more info on how vaults work (#56183) also add warning about what it covers. (cherry picked from commit 8ff27c4e0c8cb34acfa04566bbc676c943a37a87) * Fix var naming in GCE guide (cherry picked from commit dae5564e2b9f5c3cc8782dc6cac57e9402859f8d) * dev_guide: Various small updates (#53273) * Document the clarifications that I usually remark when doing reviews * Update docs/docsite/rst/dev_guide/developing_modules_documenting.rst Co-Authored-By: dagwieers <dag@wieers.com> (cherry picked from commit eac7f1fb584a9689a2acbc15a17c7bbd37acf690) * Lack of "--update" flag in older Ubuntu distros (#56283): when installing on older Ubuntu distributions be aware of the lack of ``-u`` or ``--update`` flag. (cherry picked from commit dd0b0ae47b3e01ca45691ab19accbf74b38540c4) * should have gone into 52373 (#56306) (cherry picked from commit 3c8d8b150965600b50695e77fa8ffb73463b8f6a)
2019-05-13 13:22:20 +00:00
- '"No such" not in result.stdout'
If you want the task to fail when only one condition is satisfied, change the ``failed_when`` definition to::
failed_when: result.rc == 0 or "No such" not in result.stdout
If you have too many conditions to fit neatly into one line, you can split it into a multi-line yaml value with ``>``::
- name: example of many failed_when conditions with OR
shell: "./myBinary"
register: ret
failed_when: >
("No such file or directory" in ret.stdout) or
(ret.stderr != '') or
(ret.rc == 10)
.. _override_the_changed_result:
2013-09-29 23:10:28 +00:00
Overriding The Changed Result
`````````````````````````````
2013-07-14 19:43:10 +00:00
2013-07-21 14:48:22 +00:00
When a shell/command or other module runs it will typically report
2013-07-23 22:49:27 +00:00
"changed" status based on whether it thinks it affected machine state.
2013-07-21 14:48:22 +00:00
Sometimes you will know, based on the return code
or output that it did not make any changes, and wish to override
the "changed" result such that it does not appear in report output or
does not cause handlers to fire::
2013-07-14 19:43:10 +00:00
tasks:
2013-07-21 14:48:22 +00:00
- shell: /usr/bin/billybass --mode="take me to the river"
register: bass_result
changed_when: "bass_result.rc != 2"
# this will never report 'changed' status
- shell: wall 'beep'
2013-10-18 18:13:13 +00:00
changed_when: False
2013-07-14 19:43:10 +00:00
You can also combine multiple conditions to override "changed" result::
- command: /bin/fake_command
register: result
ignore_errors: True
changed_when:
- '"ERROR" in result.stderr'
- result.rc == 2
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 mark all hosts as failed if any fails, causing an immediate abort::
- hosts: somehosts
any_errors_fatal: true
roles:
- myrole
for finer-grained control ``max_fail_percentage`` can be used to abort the run after a given percentage of hosts has failed.
Using blocks
````````````
Most of what you can apply to a single task (with the exception of loops) can be applied at the :ref:`playbooks_blocks` level, which also makes it much easier to set data or directives common to the tasks.
Blocks also introduce the ability to handle errors in a way similar to exceptions in most programming languages.
Blocks only deal with 'failed' status of a task. A bad task definition or an unreachable host are not 'rescuable' errors::
tasks:
- name: Handle the error
block:
- debug:
msg: 'I execute normally'
- name: i force a failure
command: /bin/false
- debug:
msg: 'I never execute, due to the above task failing, :-('
rescue:
- debug:
msg: 'I caught an error, can do stuff here to fix it, :-)'
Backport/2.8/docs rst omnibus (#56310) * Update windows_setup.rst (#55535): Wrong protocol and port in command. (cherry picked from commit 6ea3eca8ffa6a648243f3d6bf068bd5705e1db47) * Clarify the two targets of vault encryption, with notes about advantages and drawbacks of each Co-Authored-By: tacatac <taca@kadisius.eu> (cherry picked from commit 79198cad7a5d43e4c4e9adf6b04b3106e332399b) * Improve consistency of loop documentation (#55674) (cherry picked from commit a5cb47d6975c8e324249085934e698997ed4cc72) * Add Microsoft Document URL for WinRM Memory Hotfix (#55680) Co-Authored-By: hiyokotaisa <thel.vadam2485@gmail.com> (cherry picked from commit 7b86208fcd85b327a357d65c083e1ac582185ddf) * Clarify the documentation for `async` and `poll`; describe the behavior when `poll` = 0 and when it does not. Co-Authored-By: tacatac <taca@kadisius.eu> (cherry picked from commit dbc64ae64cb50d25855efe8b55487f66d4c82191) * Add security group info and example to AWS guide (#55783): expand documentation on how to use lookup plugin aws_service_ip_ranges with ec2_group module (cherry picked from commit bb5059f2c7d688fae041ca38af15da1c7c4cf2c7) * correct description of modules vs plugins (#55784) (cherry picked from commit 9d5b5d7ddd161e7996baf0b5bb48a22153a8a7e8) * Fix var naming (#55795): Make vars match tasks in Google Compute guide. (cherry picked from commit 943f7334c54ffe26454644ebdce5317e29e84ac4) * Clarifies how Ansible processes multiple `failed_when` conditions (#55941): multiple failed_when conditions join with AND not OR to counter third-party pages online incorrectly stating that it uses `OR`. ([example](https://groups.google.com/d/msg/ansible-project/cIaQTmY3ZLE/c5w8rlmdHWIJ)). (cherry picked from commit 5439eb8bd832a70aa5dc3a675585f38663faa753) * Docs: edits & expands module_utils & search path info in dev guide (#55931) (cherry picked from commit 8542459b959366964818025482a24c6602655d1c) * Add faq note about ssh ServerAliveInterval (#55568) (cherry picked from commit 76dba7aa4f5fa2dfd561add2771d7b8d123bdbf1) * docsite: correct path, list requirements for testing module docs, etc. (#52008) * dev_guide: correct path, list requirements, etc.; module HTML docs are in '_build/html/module' subdir (cherry picked from commit b14f477bee403f62811bf1ade93aadd1913cdf5b) * Developer documentation update involving module invocation (#55747) * Update docs for the 2.7 change to AnsiballZ which invokes modules with one less Python interpreter * Add a section on how module results are returned and on trust between modules, action plugins, and the executor. * Update docs/docsite/rst/dev_guide/developing_program_flow_modules.rst Co-Authored-By: abadger <a.badger@gmail.com> (cherry picked from commit edafa71f424345f26cd85d348b876839837a8177) * add doc example of multiline failed_when with OR (#56007) * add variety to multiple OR failed_when doc example (cherry picked from commit 7d5ada71616af96ceec7295aa089009c0ad12f92) * Note that by default the regex test is identical to match, but can do much more (#50205) * Note that the regex test behaves like 'match', with default settings (cherry picked from commit 86e98c521307fc929b1c27180e6a697ebf4a459d) * more info on how vaults work (#56183) also add warning about what it covers. (cherry picked from commit 8ff27c4e0c8cb34acfa04566bbc676c943a37a87) * Fix var naming in GCE guide (cherry picked from commit dae5564e2b9f5c3cc8782dc6cac57e9402859f8d) * dev_guide: Various small updates (#53273) * Document the clarifications that I usually remark when doing reviews * Update docs/docsite/rst/dev_guide/developing_modules_documenting.rst Co-Authored-By: dagwieers <dag@wieers.com> (cherry picked from commit eac7f1fb584a9689a2acbc15a17c7bbd37acf690) * Lack of "--update" flag in older Ubuntu distros (#56283): when installing on older Ubuntu distributions be aware of the lack of ``-u`` or ``--update`` flag. (cherry picked from commit dd0b0ae47b3e01ca45691ab19accbf74b38540c4) * should have gone into 52373 (#56306) (cherry picked from commit 3c8d8b150965600b50695e77fa8ffb73463b8f6a)
2019-05-13 13:22:20 +00:00
This will 'revert' the failed status of the outer ``block`` task for the run and the play will continue as if it had succeeded.
See :ref:`block_error_handling` for more examples.
2012-05-13 15:00:02 +00:00
.. seealso::
:doc:`playbooks`
An introduction to playbooks
:doc:`playbooks_best_practices`
Best practices in playbooks
:doc:`playbooks_conditionals`
Conditional statements in playbooks
:doc:`playbooks_variables`
All about variables
`User Mailing List <https://groups.google.com/group/ansible-devel>`_
Have a question? Stop by the google group!
`irc.freenode.net <http://irc.freenode.net>`_
#ansible IRC chat channel