diff --git a/changelogs/fragments/204-input-output-type-ini.yml b/changelogs/fragments/204-input-output-type-ini.yml new file mode 100644 index 0000000..a2e1258 --- /dev/null +++ b/changelogs/fragments/204-input-output-type-ini.yml @@ -0,0 +1,3 @@ +minor_changes: + - "decrypt filter plugin - now supports the input and output type ``ini`` (https://github.com/ansible-collections/community.sops/pull/204)." + - "sops lookup plugin - now supports the input and output type ``ini`` (https://github.com/ansible-collections/community.sops/pull/204)." diff --git a/plugins/filter/decrypt.py b/plugins/filter/decrypt.py index 2418cad..728ec54 100644 --- a/plugins/filter/decrypt.py +++ b/plugins/filter/decrypt.py @@ -36,12 +36,14 @@ - There is no auto-detection since we do not have a filename. By default SOPS is told to treat the input as YAML. If that is wrong, please set this option to the correct value. + - The value V(ini) is available since community.sops 1.9.0. type: str choices: - binary - json - yaml - dotenv + - ini default: yaml output_type: description: @@ -49,12 +51,14 @@ - Please note that the output is always text or bytes, depending on the value of O(decode_output). To parse the resulting JSON or YAML, use corresponding filters such as P(ansible.builtin.from_json#filter) and P(ansible.builtin.from_yaml#filter). + - The value V(ini) is available since community.sops 1.9.0. type: str choices: - binary - json - yaml - dotenv + - ini default: yaml decode_output: description: @@ -111,7 +115,7 @@ from ansible_collections.community.sops.plugins.module_utils.sops import Sops, SopsError -_VALID_TYPES = set(['binary', 'json', 'yaml', 'dotenv']) +_VALID_TYPES = set(['binary', 'json', 'yaml', 'dotenv', 'ini']) def decrypt_filter(data, input_type='yaml', output_type='yaml', sops_binary='sops', rstrip=True, decode_output=True, diff --git a/plugins/lookup/sops.py b/plugins/lookup/sops.py index d6c8571..5b0851e 100644 --- a/plugins/lookup/sops.py +++ b/plugins/lookup/sops.py @@ -35,24 +35,28 @@ - By default, SOPS will chose the input type from the file extension. If it detects the wrong type for a file, this could result in decryption failing. + - The value V(ini) is available since community.sops 1.9.0. type: str choices: - binary - json - yaml - dotenv + - ini output_type: description: - Tell SOPS how to interpret the decrypted file. - By default, SOPS will chose the output type from the file extension. If it detects the wrong type for a file, this could result in decryption failing. + - The value V(ini) is available since community.sops 1.9.0. type: str choices: - binary - json - yaml - dotenv + - ini empty_on_not_exist: description: - When set to V(true), will not raise an error when a file cannot be found,