mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Clear host errors (#18127)
* document meta: clear_host_errors * Update playbooks_error_handling.rst Minor edit
This commit is contained in:
parent
fcca6245d1
commit
b339d4cfe2
1 changed files with 16 additions and 6 deletions
|
@ -18,18 +18,28 @@ Ignoring Failed Commands
|
|||
|
||||
.. versionadded:: 0.6
|
||||
|
||||
Generally playbooks will stop executing any more steps on a host that
|
||||
has a failure. Sometimes, though, you want to continue on. To do so,
|
||||
write a task that looks like this::
|
||||
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
|
||||
command: /bin/false
|
||||
ignore_errors: yes
|
||||
|
||||
Note that the above system only governs the return value of failure of the particular task,
|
||||
so if you have an undefined variable used, it will still raise an error that users will need to address.
|
||||
Neither will this prevent failures on connection nor execution issues, the task must be able to run and
|
||||
return a value of 'failed'.
|
||||
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.
|
||||
|
||||
|
||||
.. _handlers_and_failure:
|
||||
|
|
Loading…
Reference in a new issue