diff --git a/lib/ansible/plugins/filter/b64decode.yml b/lib/ansible/plugins/filter/b64decode.yml new file mode 100644 index 00000000000..af71452fcb9 --- /dev/null +++ b/lib/ansible/plugins/filter/b64decode.yml @@ -0,0 +1,25 @@ +DOCUMENTATION: + name: b64decode + author: ansible core team + version_added: 'historical' + short_description: Decode a base64 string + description: + - Base64 decoding function + positional: _input + options: + _input: + description: A base64 string to decode + type: string + required: true + +EXAMPLES: | + # b64 decode a string + lola: "{{ 'bG9sYQ=='|b64decode }}" + + # b64 decode the content of 'b64stuff' variable + stuff: "{{ b64stuff|b64encode }}" + +RETURN: + _value: + description: the contents of the base64 encoded string + type: string diff --git a/lib/ansible/plugins/filter/b64encode.yml b/lib/ansible/plugins/filter/b64encode.yml new file mode 100644 index 00000000000..e830d655d17 --- /dev/null +++ b/lib/ansible/plugins/filter/b64encode.yml @@ -0,0 +1,25 @@ +DOCUMENTATION: + name: b64encode + author: ansible core team + version_added: 'historical' + short_description: Encode a string as base64 + description: + - Base64 encoding function + positional: _input + options: + _input: + description: A string to encode + type: string + required: true + +EXAMPLES: | + # b64 encode a string + b64lola: "{{ 'lola'|b64encode }}" + + # b64 encode the content of 'stuff' variable + b64stuff: "{{ stuff|b64encode }}" + +RETURN: + _value: + description: A base64 encoded string + type: string