ansible / ansible.builtin / v2.5.10 / module / assert Asserts given expressions are true | "added in version" 1.5 of ansible.builtin" Authors: Ansible Core Team, Michael DeHaan stableinterface | supported by coreansible.builtin.assert (v2.5.10) — module
pip
Install with pip install ansible==2.5.10
This module asserts that given expressions are true with an optional custom message.
This module is also supported for Windows targets.
- assert: { that: "ansible_os_family != 'RedHat'" }
- assert: that: - "'foo' in some_command_result.stdout" - "number_of_the_counting == 3"
- assert: that: - "my_param <= 100" - "my_param >= 0" msg: "'my_param' must be between 0 and 100"
msg: description: - The customized message used for a failing assertion that: description: - A string expression of the same form that can be passed to the 'when' statement - Alternatively, a list of string expressions required: true