mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
Ensure that apt is always chosen on debian/ubuntu (#44413)
One can install alternate packages managers on debuntu machines. However, doing so doesn't mean you want to suddenly start using them. Add in a check similar to the fedora yum/dnf check that sets apt as the pkg_mgr if the ansible_os_family is Debian.
This commit is contained in:
parent
6d52afeed6
commit
27ac2fc67c
3 changed files with 32 additions and 0 deletions
|
@ -122,6 +122,10 @@ class PkgMgrFactCollector(BaseFactCollector):
|
|||
if collected_facts['ansible_os_family'] == "RedHat":
|
||||
if pkg_mgr_name not in ('yum', 'dnf'):
|
||||
pkg_mgr_name = self._check_rh_versions(pkg_mgr_name, collected_facts)
|
||||
elif collected_facts['ansible_os_family'] == 'Debian' and pkg_mgr_name != 'apt':
|
||||
# It's possible to install yum, dnf, zypper, rpm, etc inside of
|
||||
# Debian. Doing so does not mean the system wants to use them.
|
||||
pkg_mgr_name = 'apt'
|
||||
elif collected_facts['ansible_os_family'] == 'Altlinux':
|
||||
if pkg_mgr_name == 'apt':
|
||||
pkg_mgr_name = 'apt_rpm'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue