From 95a9ff0587adece32817b4f432588b1ab76a5972 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Thu, 12 Nov 2015 14:49:20 +1100 Subject: [PATCH] Add option to skip EPEL & other repo installs Add an option to skip the EPEL & other repo installs for rhel7 based platforms. This option can serve two purposes; firstly as described in I834f20e9ceae151788cec3649385da1274d7ba46 during platform bringup, a publically available EPEL might not be available. This will allow you to pre-configure a hand-built repo, etc. so you can continue testing. The other thing is that in a CI system you might be frequently building images and pre-installing EPEL/RDO etc. In that case this is just extra work. Change-Id: I9809449f4a43fa9b547c6e3ca92722c7f6e66d6a --- stack.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/stack.sh b/stack.sh index 9b811b7b67..e31cd604c5 100755 --- a/stack.sh +++ b/stack.sh @@ -263,9 +263,7 @@ fi # Some distros need to add repos beyond the defaults provided by the vendor # to pick up required packages. -if is_fedora && [[ $DISTRO == "rhel7" ]]; then - # RHEL requires EPEL for many Open Stack dependencies - +function _install_epel_and_rdo { # NOTE: We always remove and install latest -- some environments # use snapshot images, and if EPEL version updates they break # unless we update them to latest version. @@ -295,18 +293,27 @@ EOF sudo yum-config-manager --enable epel-bootstrap yum_install epel-release || \ die $LINENO "Error installing EPEL repo, cannot continue" - # EPEL rpm has installed it's version sudo rm -f /etc/yum.repos.d/epel-bootstrap.repo # ... and also optional to be enabled sudo yum-config-manager --enable rhel-7-server-optional-rpms + # install the lastest RDO sudo yum install -y https://rdoproject.org/repos/rdo-release.rpm if is_oraclelinux; then sudo yum-config-manager --enable ol7_optional_latest ol7_addons ol7_MySQL56 fi +} +# If you have all the repos installed above already setup (e.g. a CI +# situation where they are on your image) you may choose to skip this +# to speed things up +SKIP_EPEL_INSTALL=$(trueorfalse False SKIP_EPEL_INSTALL) + +if is_fedora && [[ $DISTRO == "rhel7" ]] && \ + [[ ${SKIP_EPEL_INSTALL} != True ]]; then + _install_epel_and_rdo fi