New in version 1.5.
Parameter | Choices/Defaults | Comments |
---|---|---|
fail_msg
(added in 2.7) |
The customized message used for a failing assertion
This argument was called 'msg' before version 2.7, now it's renamed to 'fail_msg' with alias 'msg'
aliases: msg |
|
success_msg
(added in 2.7) |
The customized message used for a successful assertion
|
|
that
required |
A string expression of the same form that can be passed to the 'when' statement
Alternatively, a list of string expressions
|
- assert: { that: "ansible_os_family != 'RedHat'" }
- assert:
that:
- "'foo' in some_command_result.stdout"
- "number_of_the_counting == 3"
- name: after version 2.7 both 'msg' and 'fail_msg' can customize failing assertion message
assert:
that:
- "my_param <= 100"
- "my_param >= 0"
fail_msg: "'my_param' must be between 0 and 100"
success_msg: "'my_param' is between 0 and 100"
- name: please use 'msg' when ansible version is smaller than 2.7
assert:
that:
- "my_param <= 100"
- "my_param >= 0"
msg: "'my_param' must be between 0 and 100"
This module is flagged as stableinterface which means that the maintainers for this module guarantee that no backward incompatible interface changes will be made.
For more information about Red Hat’s support of this module, please refer to this Knowledge Base article
Hint
If you notice any issues in this documentation you can edit this document to improve it.