From 2f2350e78acf79b539b30e55307e3e435cfea109 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Wed, 2 Dec 2015 18:11:51 +1100 Subject: [PATCH] Add $YUM to pickup dnf on Fedora>=22 dnf is a drop-in replacement for yum on Fedora>=22; add $YUM so we use dnf there and avoid the deprecation warnings. Change-Id: I3d62d8f6d8705b2cf840b63ffd82927a408d75aa --- install_puppet.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/install_puppet.sh b/install_puppet.sh index 8972fbcef0..ab9bf644a4 100755 --- a/install_puppet.sh +++ b/install_puppet.sh @@ -42,6 +42,13 @@ function is_opensuse { cat /etc/os-release | grep -q -e "openSUSE" } +# dnf is a drop-in replacement for yum on Fedora>=22 +YUM=yum +if is_fedora && [[ $(lsb_release -rs) -ge 22 ]]; then + YUM=dnf +fi + + # # Distro specific puppet installs # @@ -51,16 +58,17 @@ function _systemd_update { # services due to selinux errors after upgrade. A work-around is # to install the latest version of selinux and systemd here and # restart the daemon for good measure after it is upgraded. - yum install -y selinux-policy - yum install -y systemd + $YUM install -y selinux-policy + $YUM install -y systemd systemctl daemon-reload } function setup_puppet_fedora { _systemd_update - yum update -y - # NOTE: we preinstall lsb_release to ensure facter sets + $YUM update -y + + # NOTE: we preinstall lsb_release here to ensure facter sets # lsbdistcodename # # Fedora declares some global hardening flags, which distutils @@ -70,7 +78,7 @@ function setup_puppet_fedora { # https://bugzilla.redhat.com/show_bug.cgi?id=1217376) and can be # removed when that is sorted out. - yum install -y redhat-lsb-core git puppet \ + $YUM install -y redhat-lsb-core git puppet \ redhat-rpm-config mkdir -p /etc/puppet/modules/