diff --git a/changelogs/fragments/49184-facts-rpm-ostree-pkgmgr.yml b/changelogs/fragments/49184-facts-rpm-ostree-pkgmgr.yml new file mode 100644 index 0000000000..871f785c89 --- /dev/null +++ b/changelogs/fragments/49184-facts-rpm-ostree-pkgmgr.yml @@ -0,0 +1,2 @@ +bugfixes: +- "facts - properly detect package manager for a Fedora/RHEL/CentOS system that has rpm-ostree installed" diff --git a/lib/ansible/module_utils/facts/system/pkg_mgr.py b/lib/ansible/module_utils/facts/system/pkg_mgr.py index ebb19944eb..e40c5e028b 100644 --- a/lib/ansible/module_utils/facts/system/pkg_mgr.py +++ b/lib/ansible/module_utils/facts/system/pkg_mgr.py @@ -61,6 +61,8 @@ class PkgMgrFactCollector(BaseFactCollector): def _check_rh_versions(self, pkg_mgr_name, collected_facts): if collected_facts['ansible_distribution'] == 'Fedora': + if os.path.exists('/run/ostree-booted'): + return "atomic_container" try: if int(collected_facts['ansible_distribution_major_version']) < 23: for yum in [pkg_mgr for pkg_mgr in PKG_MGRS if pkg_mgr['name'] == 'yum']: