mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 05:12:45 +00:00
correctly detect pkg_mgr on fedora/rhel/centos rpm-ostree installed (#49256)
Check the path /run/ostree-booted which I'm told by upstream that it will always be present when a host system is Fedora/RHEL/CentOS Atomic/CoreOS vs "traditional" distro instance to detect the non-traditional instance and ensure pkg_mgr selection is correct Signed-off-by: Adam Miller <admiller@redhat.com>
This commit is contained in:
2
changelogs/fragments/49184-facts-rpm-ostree-pkgmgr.yml
Normal file
2
changelogs/fragments/49184-facts-rpm-ostree-pkgmgr.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
bugfixes:
|
||||
- "facts - properly detect package manager for a Fedora/RHEL/CentOS system that has rpm-ostree installed"
|
||||
@@ -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']:
|
||||
|
||||
Reference in New Issue
Block a user