Always install latest EPEL

Having issues with the centos7 job, that seem to be because they use
an old snapshot that hasn't updated to the latest EPEL.  Thus we
re-install it to ensure we're getting the latest.

Change-Id: I7930f3e05ee953dab80b06142c17d6aa70f2c2d1
This commit is contained in:
Ian Wienand 2014-10-22 11:35:29 +11:00
parent 572a4c4c3c
commit ed077b2846

View File

@ -234,8 +234,14 @@ fi
if [[ is_fedora && ( $DISTRO == "rhel6" || $DISTRO == "rhel7" ) ]]; then
# RHEL requires EPEL for many Open Stack dependencies
if ! sudo yum repolist enabled epel | grep -q 'epel'; then
echo "EPEL not detected; installing"
# note we always remove and install latest -- some environments
# use snapshot images, and if EPEL version updates they break
# unless we update them to latest version.
if sudo yum repolist enabled epel | grep -q 'epel'; then
uninstall_package epel-release || true
fi
# This trick installs the latest epel-release from a bootstrap
# repo, then removes itself (as epel-release installed the
# "real" repo).
@ -251,7 +257,7 @@ if [[ is_fedora && ( $DISTRO == "rhel6" || $DISTRO == "rhel7" ) ]]; then
fi
cat <<EOF | sudo tee /etc/yum.repos.d/epel-bootstrap.repo
[epel]
[epel-bootstrap]
name=Bootstrap EPEL
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-$epel_ver&arch=\$basearch
failovermethod=priority
@ -259,11 +265,10 @@ enabled=0
gpgcheck=0
EOF
# bare yum call due to --enablerepo
sudo yum --enablerepo=epel -y install epel-release || \
sudo yum --enablerepo=epel-bootstrap -y install epel-release || \
die $LINENO "Error installing EPEL repo, cannot continue"
# epel rpm has installed it's version
sudo rm -f /etc/yum.repos.d/epel-bootstrap.repo
fi
# ... and also optional to be enabled
is_package_installed yum-utils || install_package yum-utils