diff options
author | Timothy Appnel <tima@ansible.com> | 2016-09-20 11:51:57 -0400 |
---|---|---|
committer | James Cammarata <jimi@sngx.net> | 2016-09-20 10:51:57 -0500 |
commit | b87bf7c12d8117a5dcb53d7b5312f9ed20eb1901 (patch) | |
tree | eaf22b2b8b2d0568004e82dceb0b0f3b953ce65c /utilities | |
parent | 3a2cfadb3195286d46d7572b33b8b1aa1815df8a (diff) | |
download | ansible-modules-core-b87bf7c12d8117a5dcb53d7b5312f9ed20eb1901.tar.gz |
Adds docs for msg param in assert modules plus some other clean up (#4926)
Diffstat (limited to 'utilities')
-rw-r--r-- | utilities/logic/assert.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/utilities/logic/assert.py b/utilities/logic/assert.py index e9e359f4..9600b9d1 100644 --- a/utilities/logic/assert.py +++ b/utilities/logic/assert.py @@ -21,9 +21,9 @@ DOCUMENTATION = ''' --- module: assert -short_description: Fail with custom message +short_description: Asserts given expressions are true description: - - This module asserts that a given expression is true and can be a simpler alternative to the 'fail' module in some cases. + - This module asserts that given expressions are true with an optional custom message. version_added: "1.5" options: that: @@ -31,6 +31,10 @@ options: - "A string expression of the same form that can be passed to the 'when' statement" - "Alternatively, a list of string expressions" required: true + msg: + description: + - "The customized message used for a failing assertion" + required: false author: - "Ansible Core Team" - "Michael DeHaan" @@ -43,4 +47,10 @@ EXAMPLES = ''' that: - "'foo' in some_command_result.stdout" - "number_of_the_counting == 3" + +- assert: + that: + - "my_param <= 100" + - "my_param >= 0" + msg: "'my_param' is must be between 0 and 100" ''' |