Browse code

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

Ian Wienand authored on 2015/11/12 12:49:20
Showing 1 changed files
... ...
@@ -263,9 +263,7 @@ fi
263 263
 # Some distros need to add repos beyond the defaults provided by the vendor
264 264
 # to pick up required packages.
265 265
 
266
-if is_fedora && [[ $DISTRO == "rhel7" ]]; then
267
-    # RHEL requires EPEL for many Open Stack dependencies
268
-
266
+function _install_epel_and_rdo {
269 267
     # NOTE: We always remove and install latest -- some environments
270 268
     # use snapshot images, and if EPEL version updates they break
271 269
     # unless we update them to latest version.
... ...
@@ -295,18 +293,27 @@ EOF
295 295
     sudo yum-config-manager --enable epel-bootstrap
296 296
     yum_install epel-release || \
297 297
         die $LINENO "Error installing EPEL repo, cannot continue"
298
-    # EPEL rpm has installed it's version
299 298
     sudo rm -f /etc/yum.repos.d/epel-bootstrap.repo
300 299
 
301 300
     # ... and also optional to be enabled
302 301
     sudo yum-config-manager --enable rhel-7-server-optional-rpms
303 302
 
303
+    # install the lastest RDO
304 304
     sudo yum install -y https://rdoproject.org/repos/rdo-release.rpm
305 305
 
306 306
     if is_oraclelinux; then
307 307
         sudo yum-config-manager --enable ol7_optional_latest ol7_addons ol7_MySQL56
308 308
     fi
309
+}
310
+
311
+# If you have all the repos installed above already setup (e.g. a CI
312
+# situation where they are on your image) you may choose to skip this
313
+# to speed things up
314
+SKIP_EPEL_INSTALL=$(trueorfalse False SKIP_EPEL_INSTALL)
309 315
 
316
+if is_fedora && [[ $DISTRO == "rhel7" ]] && \
317
+        [[ ${SKIP_EPEL_INSTALL} != True ]]; then
318
+    _install_epel_and_rdo
310 319
 fi
311 320
 
312 321