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

NameTypeRequiredDefaultDescription
thatlistyesA list of strings, each should be a test expression
fail_msgstringThe customized message used when the assertion fails
success_msgstringThe customized message used when the assertion succeeds
quietboolfalseSet 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