Check for epel before installing it

instack runs this script on a system where epel has already been
installed, which causes the yum command to fail.  Only installing
the epel-release rpm when it isn't already present addresses the
issue.

Change-Id: Ia179d7c7ed69ea5f785b5dcd16394c7663a145cc
This commit is contained in:
Ben Nemec 2014-10-09 13:00:12 -05:00
parent 8a8bbb5673
commit e5a2e07301

View File

@ -3,7 +3,7 @@ set -eu
set -o pipefail
if [[ "rhel7 centos7" =~ "$DISTRO_NAME" ]]; then
yum install -y http://download.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-2.noarch.rpm
rpm -q epel-release || yum install -y http://download.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-2.noarch.rpm
elif [[ "rhel" =~ "$DISTRO_NAME" ]]; then
yum install -y http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -q epel-release || yum install -y http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
fi