Add option to set EPEL mirror
In some environments it may be desirable to set the EPEL mirror to use. Add this ability. Change-Id: Iefa22bde7a64b40e6d36ba39efa9102de9393e06
This commit is contained in:
parent
7db3196e68
commit
6b82210f9d
@ -3,3 +3,11 @@ epel
|
||||
====
|
||||
This element installs the Extra Packages for Enterprise Linux (EPEL)
|
||||
repository GPG key as well as configuration for yum.
|
||||
|
||||
DIB_EPEL_MIRROR:
|
||||
:Required: No
|
||||
:Default: None
|
||||
:Description: To use a EPEL Yum mirror, set this variable to the mirror URL
|
||||
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``
|
||||
|
@ -29,3 +29,10 @@ case "$DISTRO_NAME" in
|
||||
esac
|
||||
PKG_NAME=$(wget -q $URL -O - |grep -oE "(href=\"epel-release-$RELEASE-[0-9,.].*)" | cut -d'"' -f2)
|
||||
rpm -q epel-release || yum install -y $URL/$PKG_NAME
|
||||
|
||||
|
||||
DIB_EPEL_MIRROR=${DIB_EPEL_MIRROR:-}
|
||||
[ -n "$DIB_EPEL_MIRROR" ] || exit 0
|
||||
|
||||
# Set the EPEL mirror to use
|
||||
sed -e "s|^#baseurl=http://download.fedoraproject.org/pub/epel|baseurl=$DIB_EPEL_MIRROR|;/^mirrorlist=/d" -i /etc/yum.repos.d/epel.repo
|
||||
|
Loading…
Reference in New Issue
Block a user