From aead2bf7832270c3b41fcfff2f5d4edd1d81d43d Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Sun, 30 Jan 2022 21:57:31 +0100 Subject: [PATCH] Set LANG and similar env variables to prevent translated cryptsetup output. (#388) (#390) (cherry picked from commit ea2e45d63f2a3068590f3d2c08f1dca0128cd1e2) Co-authored-by: Felix Fontein --- changelogs/fragments/388-luks_device-i18n.yml | 2 ++ plugins/modules/luks_device.py | 1 + 2 files changed, 3 insertions(+) create mode 100644 changelogs/fragments/388-luks_device-i18n.yml diff --git a/changelogs/fragments/388-luks_device-i18n.yml b/changelogs/fragments/388-luks_device-i18n.yml new file mode 100644 index 00000000..70dbad36 --- /dev/null +++ b/changelogs/fragments/388-luks_device-i18n.yml @@ -0,0 +1,2 @@ +bugfixes: + - "luks_devices - set ``LANG`` and similar environment variables to avoid translated output, which can break some of the module's functionality like key management (https://github.com/ansible-collections/community.crypto/pull/388, https://github.com/ansible-collections/community.crypto/issues/385)." diff --git a/plugins/modules/luks_device.py b/plugins/modules/luks_device.py index ddaedd24..e3a744c2 100644 --- a/plugins/modules/luks_device.py +++ b/plugins/modules/luks_device.py @@ -821,6 +821,7 @@ def run_module(): module = AnsibleModule(argument_spec=module_args, supports_check_mode=True, mutually_exclusive=mutually_exclusive) + module.run_command_environ_update = dict(LANG='C', LC_ALL='C', LC_MESSAGES='C', LC_CTYPE='C') if module.params['device'] is not None: try: