diff --git a/lib/ansible/module_utils/facts/system/pkg_mgr.py b/lib/ansible/module_utils/facts/system/pkg_mgr.py index db18bb0ee5a..a8fcf0929dc 100644 --- a/lib/ansible/module_utils/facts/system/pkg_mgr.py +++ b/lib/ansible/module_utils/facts/system/pkg_mgr.py @@ -78,5 +78,10 @@ class PkgMgrFactCollector(BaseFactCollector): if os.path.exists(pkg['path']): pkg_mgr_name = pkg['name'] + if pkg_mgr_name == 'apt' and \ + os.path.exists('/usr/bin/rpm') and \ + not os.path.exists('/usr/bin/dpkg'): + pkg_mgr_name = 'apt_rpm' + facts_dict['pkg_mgr'] = pkg_mgr_name return facts_dict