From 0fabf2109f32c14b38d5b1af0aeff57425a44704 Mon Sep 17 00:00:00 2001 From: Till Maas Date: Wed, 22 Aug 2018 19:27:03 +0200 Subject: [PATCH] service_facts: Use LC_ALL/LANG=C to run commands (#44474) This allows to parse the output when the user's locale changes the commands' output. For example chkconfig uses 'Ein' and 'Aus' instead of 'on' and 'off' when using LANG=de_DE.UTF-8 breaking the service detection on RHEL 6. --- lib/ansible/modules/system/service_facts.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/ansible/modules/system/service_facts.py b/lib/ansible/modules/system/service_facts.py index e5e06980f3..ccfc0aa323 100644 --- a/lib/ansible/modules/system/service_facts.py +++ b/lib/ansible/modules/system/service_facts.py @@ -202,6 +202,7 @@ class SystemctlScanService(BaseService): def main(): module = AnsibleModule(argument_spec=dict(), supports_check_mode=True) + module.run_command_environ_update = dict(LANG="C", LC_ALL="C") service_modules = (ServiceScanService, SystemctlScanService) all_services = {} incomplete_warning = False