Browse code

Install EPEL for rhel6 if not detected

Simple check to see if EPEL repo is enabled for RHEL6 and, if not,
automated install of the repo RPM.

Also adds an additional sanity check which checking for pip. In the
prior case of EPEL being disabled, a RHEL6 host may not have access to
python-pip. Although this shouldn't happen, its a good sanity check.

Change-Id: I4e8a4dda9475b75d071534d4eef469198502a048

Ian Wienand authored on 2013/05/15 08:25:27
Showing 2 changed files
... ...
@@ -1413,6 +1413,10 @@ function get_pip_command() {
1413 1413
     else
1414 1414
         which pip
1415 1415
     fi
1416
+
1417
+    if [ $? -ne 0 ]; then
1418
+        die $LINENO "Unable to find pip; cannot continue"
1419
+    fi
1416 1420
 }
1417 1421
 
1418 1422
 # Path permissions sanity check
... ...
@@ -51,13 +51,24 @@ fi
51 51
 # Installing Open vSwitch on RHEL6 requires enabling the RDO repo.
52 52
 RHEL6_RDO_REPO_RPM=${RHEL6_RDO_REPO_RPM:-"http://rdo.fedorapeople.org/openstack/openstack-grizzly/rdo-release-grizzly-3.noarch.rpm"}
53 53
 RHEL6_RDO_REPO_ID=${RHEL6_RDO_REPO_ID:-"openstack-grizzly"}
54
+# RHEL6 requires EPEL for many Open Stack dependencies
55
+RHEL6_EPEL_RPM=${RHEL6_EPEL_RPM:-"http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm"}
56
+
54 57
 if [[ is_fedora && $DISTRO =~ (rhel6) ]]; then
58
+
55 59
     if ! yum repolist enabled $RHEL6_RDO_REPO_ID | grep -q $RHEL6_RDO_REPO_ID; then
56 60
         echo "RDO repo not detected; installing"
57
-        yum_install $RHEL6_RDO_REPO_RPM
61
+        yum_install $RHEL6_RDO_REPO_RPM || \
62
+            die $LINENO "Error installing RDO repo, cannot continue"
58 63
     fi
59
-fi
60 64
 
65
+    if ! yum repolist enabled epel | grep -q 'epel'; then
66
+        echo "EPEL not detected; installing"
67
+        yum_install ${RHEL6_EPEL_RPM} || \
68
+            die $LINENO "Error installing EPEL repo, cannot continue"
69
+    fi
70
+
71
+fi
61 72
 
62 73
 # Global Settings
63 74
 # ===============