mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-12 20:00:58 +00:00
module_utils/facts: override pkg_mgr for ALT Linux (#38004)
Overrides `pkg_mgr` fact to `apt_rpm` if: - found package manager is `apt`; - `/usr/bin/rpm` is present; - `/usr/bin/dpkg` is absent. Fixes #37997
This commit is contained in:
committed by
Adam Miller
parent
04e3c964fb
commit
f2d4912f29
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user