Merge "Add $YUM to pickup dnf on Fedora>=22"

This commit is contained in:
Jenkins 2016-02-02 01:06:27 +00:00 committed by Gerrit Code Review
commit d39b05bd97

View File

@ -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/