diff options
Diffstat (limited to 'lib/ansible/plugins/filter/mandatory.yml')
-rw-r--r-- | lib/ansible/plugins/filter/mandatory.yml | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/ansible/plugins/filter/mandatory.yml b/lib/ansible/plugins/filter/mandatory.yml index 5addf159..14058845 100644 --- a/lib/ansible/plugins/filter/mandatory.yml +++ b/lib/ansible/plugins/filter/mandatory.yml @@ -10,11 +10,18 @@ DOCUMENTATION: description: Mandatory expression. type: raw required: true + msg: + description: The customized message that is printed when the given variable is not defined. + type: str + required: false EXAMPLES: | # results in a Filter Error {{ notdefined | mandatory }} + # print a custom error message + {{ notdefined | mandatory(msg='This variable is required.') }} + RETURN: _value: description: The input if defined, otherwise an error. |