assert
!assert
Category: control
Abort the play (fail the task) when one or more templated condition expressions evaluate incorrectly.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
msg | string | no | Custom message shown when the assertion fails. |
true | condition | no | A condition expression that must be true. |
false | condition | no | A condition expression that must be false. |
all_true | list | no | Every expression in the list must be true. |
all_false | list | no | Every expression in the list must be false. |
some_true | list | no | At least one expression in the list must be true. |
Examples
- !assert
name: Ensure enough disk space
true: (gt disk_free_pct 20)
msg: free disk below 20%