diff --git a/lib/ansible/module_utils/facts/system/service_mgr.py b/lib/ansible/module_utils/facts/system/service_mgr.py index ff7ee7ab4a1..d983604cdb2 100644 --- a/lib/ansible/module_utils/facts/system/service_mgr.py +++ b/lib/ansible/module_utils/facts/system/service_mgr.py @@ -105,22 +105,22 @@ class ServiceMgrFactCollector(BaseFactCollector): # FIXME: replace with a system->service_mgr_name map? # start with the easy ones - elif collected_facts.get('distribution', None) == 'MacOSX': + elif collected_facts.get('ansible_distribution', None) == 'MacOSX': # FIXME: find way to query executable, version matching is not ideal if LooseVersion(platform.mac_ver()[0]) >= LooseVersion('10.4'): service_mgr_name = 'launchd' else: service_mgr_name = 'systemstarter' - elif 'BSD' in collected_facts.get('system', '') or collected_facts.get('system') in ['Bitrig', 'DragonFly']: + elif 'BSD' in collected_facts.get('ansible_system', '') or collected_facts.get('ansible_system') in ['Bitrig', 'DragonFly']: # FIXME: we might want to break out to individual BSDs or 'rc' service_mgr_name = 'bsdinit' - elif collected_facts.get('system') == 'AIX': + elif collected_facts.get('ansible_system') == 'AIX': service_mgr_name = 'src' - elif collected_facts.get('system') == 'SunOS': + elif collected_facts.get('ansible_system') == 'SunOS': service_mgr_name = 'smf' - elif collected_facts.get('distribution') == 'OpenWrt': + elif collected_facts.get('ansible_distribution') == 'OpenWrt': service_mgr_name = 'openwrt_init' - elif collected_facts.get('system') == 'Linux': + elif collected_facts.get('ansible_system') == 'Linux': # FIXME: mv is_systemd_managed if self.is_systemd_managed(module=module): service_mgr_name = 'systemd'