Install dnf on CentOS hosts

This patch adds dnf to CentOS hosts to provide better package
manager performance.

Implements: blueprint centos-and-dnf
Change-Id: Ieea80e88652dd84851aeed9a1910f86ec7ba86d0
This commit is contained in:
Major Hayden 2017-09-12 14:58:59 -06:00
parent 9b9dde4745
commit 7401dddaa2
No known key found for this signature in database
GPG Key ID: 737051E0C1011FB1

View File

@ -24,12 +24,15 @@
gather_facts: false
user: root
pre_tasks:
- name: Ensure python is installed
- name: Install prerequisites before setting up the host
register: result
raw: |
if which apt-get >/dev/null && ! which python >/dev/null ; then
if which apt-get > /dev/null && ! which python > /dev/null ; then
apt-get -y install python
exit 2
elif which yum > /dev/null && ! which dnf > /dev/null ; then
yum --disablerepo=extras -y install dnf dnf-plugins-core python-dnf
exit 2
else
exit 0
fi