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

(cherry picked from commit 4c00fc7b32)
This commit is contained in:
Tim Hunter 2019-05-30 04:18:31 -04:00 committed by Toshio Kuratomi
parent f79af725fc
commit 7d0237f4db
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,
# just default to dnf
pkg_mgr_name = 'dnf'
elif collected_facts['ansible_distribution'] == 'Amazon':
pkg_mgr_name = 'yum'
else:
# If it's not Fedora and it's Red Hat family of distros, assume RHEL
# or a clone. For versions of RHEL < 8 that Ansible supports, the
# If it's not one of the above and it's Red Hat family of distros, assume
# RHEL or a clone. For versions of RHEL < 8 that Ansible supports, the
# 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'.
# If anyone wants to force a non-official package manager then they