Add flag to disable EPEL

Add DIB_EPEL_DISABLED flag that allows installation of the EPEL repo,
but to have it disabled by default.  This will help when you have
unavoidable EPEL dependencies, but want to make sure you only pull
specific things in with "--enablerepo" calls when installing those
packages.

Change-Id: Iedf6167a7cd69418255ebbee095aea04c50d73fd
This commit is contained in:
Ian Wienand 2017-03-02 11:11:55 +11:00
parent 6e7d7e77ad
commit 8e822768f9
2 changed files with 14 additions and 0 deletions

View File

@ -1,9 +1,13 @@
====
epel
====
This element installs the Extra Packages for Enterprise Linux (EPEL)
repository GPG key as well as configuration for yum.
Note this element only works with platforms that have EPEL support
such as CentOS and RHEL
DIB_EPEL_MIRROR:
:Required: No
:Default: None
@ -11,3 +15,9 @@ DIB_EPEL_MIRROR:
before running bin/disk-image-create. This URL should point to
the directory containing the ``5/6/7`` directories.
:Example: ``DIB\_EPEL\_MIRROR=http://dl.fedoraproject.org/pub/epel``
DIB_EPEL_DISABLED:
:Required: No
:Default: 0
:Description: To disable the EPEL repo (but leave it available if
used with an explicit ``--enablerepo``) set this to 1

View File

@ -36,6 +36,10 @@ else
rpm -q epel-release || yum install -y $URL/$PKG_NAME
fi
if [ ${DIB_EPEL_DISABLED:-0} -ne 0 ]; then
yum-config-manager --disable epel
fi
DIB_EPEL_MIRROR=${DIB_EPEL_MIRROR:-}
[ -n "$DIB_EPEL_MIRROR" ] || exit 0