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

View File

@@ -24,12 +24,15 @@
gather_facts: false gather_facts: false
user: root user: root
pre_tasks: pre_tasks:
- name: Ensure python is installed - name: Install prerequisites before setting up the host
register: result register: result
raw: | 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 apt-get -y install python
exit 2 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 else
exit 0 exit 0
fi fi