Merge "Add centos7 support for DIB_DISTRIBUTION_MIRROR"
This commit is contained in:
commit
69b8823b62
@ -4,3 +4,11 @@ centos7
|
||||
Use Centos 7 cloud images as the baseline for built disk images.
|
||||
|
||||
For further details see the redhat-common README.
|
||||
|
||||
DIB_DISTRIBUTION_MIRROR:
|
||||
:Required: No
|
||||
:Default: None
|
||||
:Description: To use a CentOS 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\_DISTRIBUTION\_MIRROR=http://amirror.com/centos``
|
||||
|
15
elements/centos7/pre-install.d/01-set-centos-mirror
Executable file
15
elements/centos7/pre-install.d/01-set-centos-mirror
Executable file
@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
|
||||
set -x
|
||||
fi
|
||||
set -eu
|
||||
set -o pipefail
|
||||
|
||||
DIB_DISTRIBUTION_MIRROR=${DIB_DISTRIBUTION_MIRROR:-}
|
||||
|
||||
[ -n "$DIB_DISTRIBUTION_MIRROR" ] || exit 0
|
||||
|
||||
# Only set the mirror for the Base, Extras and Updates repositories
|
||||
# The others arn't enabled and do not exist on all mirrors
|
||||
sed -e "s|^#baseurl=http://mirror.centos.org/centos|baseurl=$DIB_DISTRIBUTION_MIRROR|;/^mirrorlist=/d" -i /etc/yum.repos.d/CentOS-Base.repo
|
Loading…
Reference in New Issue
Block a user