From fb2f080b42c16e28262ba6b9c295332e09e2bfad Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Thu, 28 Apr 2022 15:12:29 -0400 Subject: [PATCH] document base64 filters (#77657) * document base64 filters * Update lib/ansible/plugins/filter/b64decode.yml Co-authored-by: Sandra McCann * Update lib/ansible/plugins/filter/b64encode.yml Co-authored-by: Sandra McCann Co-authored-by: Sandra McCann --- lib/ansible/plugins/filter/b64decode.yml | 25 ++++++++++++++++++++++++ lib/ansible/plugins/filter/b64encode.yml | 25 ++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 lib/ansible/plugins/filter/b64decode.yml create mode 100644 lib/ansible/plugins/filter/b64encode.yml 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