knowledge/technology/tools/Ansible/modules/ansible.builtin.fail.md
2023-12-04 11:02:23 +01:00

15 lines
No EOL
630 B
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ansible.builtin.fail
This module fails the progress with a custom message.
## Parameter
| Parameter | Type | Default | Description |
| --------- | ------ | ------------------------------- | -------------------------------------------------- |
| **msg** | string | "Failed as requested from task" | The customized message used for failing execution. |
## Examples
```yaml
- name: Example using fail and when together
ansible.builtin.fail:
msg: The system may not be provisioned according to the CMDB status.
when: cmdb_status != "to-be-staged"
```