diskimage-builder/elements/epel/pre-install.d/05-rpm-epel-release
Ben Nemec e5a2e07301 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
2014-10-09 13:00:12 -05:00

9 lines
375 B
Bash
Executable file

#!/bin/bash
set -eu
set -o pipefail
if [[ "rhel7 centos7" =~ "$DISTRO_NAME" ]]; then
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
rpm -q epel-release || yum install -y http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
fi