Merge pull request #520 from rjeffman/fix_ansible_locale_over_ssh

Force plugins to execute using LANGUAGE='C'.
This commit is contained in:
Thomas Woerner
2021-05-04 10:57:46 +02:00
committed by GitHub
2 changed files with 35 additions and 0 deletions

View File

@@ -93,6 +93,9 @@ except ImportError:
if six.PY3:
unicode = str
# ansible-freeipa requires locale to be C, IPA requires utf-8.
os.environ["LANGUAGE"] = "C"
def valid_creds(module, principal): # noqa
"""Get valid credentials matching the princial, try GSSAPI first."""

View File

@@ -0,0 +1,32 @@
---
- name: Test language variations
hosts: ipaserver
tasks:
- name: Ensure a host is not present, with language set to "de_DE".
ipahost:
ipaadmin_password: SomeADMINpassword
name: nonexistent
state: absent
environment:
LANGUAGE: "de_DE"
register: result
failed_when: result.failed or result.changed
- name: Ensure a host is not present, with language set to "C".
ipahost:
ipaadmin_password: SomeADMINpassword
name: nonexistent
state: absent
environment:
LANGUAGE: "C"
register: result
failed_when: result.failed or result.changed
- name: Ensure a host is not present, using controller language.
ipahost:
ipaadmin_password: SomeADMINpassword
name: nonexistent
state: absent
register: result
failed_when: result.failed or result.changed