update pkg_mgr.py for Amazon Linux support (#56618)

This commit is contained in:
Tim Hunter 2019-05-30 04:18:31 -04:00 committed by Martin Krizek
parent ac1895453f
commit 4c00fc7b32
2 changed files with 6 additions and 2 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- pkg_mgr - Ansible 2.8.0 failing to install yum packages on Amazon Linux (https://github.com/ansible/ansible/issues/56583)

View file

@ -78,9 +78,11 @@ class PkgMgrFactCollector(BaseFactCollector):
# If there's some new magical Fedora version in the future, # If there's some new magical Fedora version in the future,
# just default to dnf # just default to dnf
pkg_mgr_name = 'dnf' pkg_mgr_name = 'dnf'
elif collected_facts['ansible_distribution'] == 'Amazon':
pkg_mgr_name = 'yum'
else: else:
# If it's not Fedora and it's Red Hat family of distros, assume RHEL # If it's not one of the above and it's Red Hat family of distros, assume
# or a clone. For versions of RHEL < 8 that Ansible supports, the # RHEL or a clone. For versions of RHEL < 8 that Ansible supports, the
# vendor supported official package manager is 'yum' and in RHEL 8+ # vendor supported official package manager is 'yum' and in RHEL 8+
# (as far as we know at the time of this writing) it is 'dnf'. # (as far as we know at the time of this writing) it is 'dnf'.
# If anyone wants to force a non-official package manager then they # If anyone wants to force a non-official package manager then they