mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-08-05 14:24:48 +00:00
Merge pull request #520 from rjeffman/fix_ansible_locale_over_ssh
Force plugins to execute using LANGUAGE='C'.
This commit is contained in:
@@ -93,6 +93,9 @@ except ImportError:
|
|||||||
if six.PY3:
|
if six.PY3:
|
||||||
unicode = str
|
unicode = str
|
||||||
|
|
||||||
|
# ansible-freeipa requires locale to be C, IPA requires utf-8.
|
||||||
|
os.environ["LANGUAGE"] = "C"
|
||||||
|
|
||||||
|
|
||||||
def valid_creds(module, principal): # noqa
|
def valid_creds(module, principal): # noqa
|
||||||
"""Get valid credentials matching the princial, try GSSAPI first."""
|
"""Get valid credentials matching the princial, try GSSAPI first."""
|
||||||
|
|||||||
32
tests/environment/test_locale.yml
Normal file
32
tests/environment/test_locale.yml
Normal 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
|
||||||
Reference in New Issue
Block a user