service_facts: Use LC_ALL/LANG=C to run commands ()

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.
This commit is contained in:
Till Maas 2018-08-22 19:27:03 +02:00 committed by Brian Coca
parent 2f9a5a75a8
commit 0fabf2109f

View file

@ -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