Skip to content

failure

Collection Note

This module is part of the ansible.builtin collection. To install the collection, use:

ansible-galaxy collection install ansible.builtin
Added in version 1.9.

Synopsis

  • Tests if task finished in failure, opposite of C(succeeded).
  • This test checks for the existence of a C(failed) key in the input dictionary and that it is V(True) if present.
  • Tasks that get skipped or not executed due to other failures (syntax, templating, unreachable host, etc) do not return a 'failed' status.

Parameters

Parameter Defaults / Choices Comments
_input
dictionary
required
registered result from an Ansible task

Examples

# test 'status' to know how to respond
{{ taskresults is failed }}

Return Values

Key Data Type Description Returned
_value boolean Returns V(True) if the task was failed, V(False) otherwise.

Authors

  • Ansible Core