assert
Collection: builtin
Full Name: assert
Controller module — runs on the local controller, not on remote hosts.
Synopsis
Fail the play unless the given conditions all hold
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| that | list | yes | A list of strings, each should be a test expression | |
| fail_msg | string | The customized message used when the assertion fails | ||
| success_msg | string | The customized message used when the assertion succeeds | ||
| quiet | bool | false | Set this to true to avoid verbose output |
Example
- name: Refuse to deploy without a version
assert:
that:
- app_version is defined
- app_version != ''
fail_msg: app_version must be set before deploying
success_msg: Version check passed