Skip to content

assert

!assert

Category: control

Abort the play (fail the task) when one or more templated condition expressions evaluate incorrectly.

Parameters

NameTypeRequiredDescription
msgstringnoCustom message shown when the assertion fails.
trueconditionnoA condition expression that must be true.
falseconditionnoA condition expression that must be false.
all_truelistnoEvery expression in the list must be true.
all_falselistnoEvery expression in the list must be false.
some_truelistnoAt 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%