diff --git a/install_puppet.sh b/install_puppet.sh index e210c018e1..37c9a1e8d7 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/