diff --git a/diskimage_builder/elements/epel/README.rst b/diskimage_builder/elements/epel/README.rst index 50464d48..a00571c8 100644 --- a/diskimage_builder/elements/epel/README.rst +++ b/diskimage_builder/elements/epel/README.rst @@ -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 diff --git a/diskimage_builder/elements/epel/pre-install.d/05-rpm-epel-release b/diskimage_builder/elements/epel/pre-install.d/05-rpm-epel-release index 5aa35624..0a4a37da 100755 --- a/diskimage_builder/elements/epel/pre-install.d/05-rpm-epel-release +++ b/diskimage_builder/elements/epel/pre-install.d/05-rpm-epel-release @@ -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