Last active
August 29, 2015 14:20
-
-
Save jcoufal/5bd376587f8f2b231332 to your computer and use it in GitHub Desktop.
RDO Kilo Test Day - instack-prepare-host
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eux | |
set -o pipefail | |
# Install repo file for Delorean master packages | |
# Pin to an older repo for now because newer openstack-keystone requires a | |
# newer and not yet avaialable python-pycadf. | |
export USE_DELOREAN_TRUNK=${USE_DELOREAN_TRUNK:-0} | |
if [ "$USE_DELOREAN_TRUNK" = "1" ]; then | |
export DELOREAN_TRUNK_REPO=${DELOREAN_TRUNK_REPO:-"http://trunk.rdoproject.org/kilo/centos7/latest-RDO-kilo-CI/"} | |
export DELOREAN_REPO_FILE=${DELOREAN_REPO_FILE:-"delorean-kilo.repo"} | |
sudo curl -o /etc/yum.repos.d/$DELOREAN_REPO_FILE $DELOREAN_TRUNK_REPO/$DELOREAN_REPO_FILE | |
# We need to have the main delorean repo have a lower priority than ours to ensure our changes get installed | |
sudo sed -i 's/priority=1/priority=10/' /etc/yum.repos.d/$DELOREAN_REPO_FILE | |
fi | |
# Install repo file for Delorean el7 midstream packages built from | |
# rdo-management. | |
export DELOREAN_TRUNK_MGT_REPO=${DELOREAN_TRUNK_MGT_REPO:-"http://trunk-mgt.rdoproject.org/repos/current-passed-ci/"} | |
sudo curl -o /etc/yum.repos.d/delorean-rdo-management.repo $DELOREAN_TRUNK_MGT_REPO/delorean-rdo-management.repo | |
# Delorean requires RDO | |
if ! rpm -q rdo-release; then | |
sudo yum install -y https://repos.fedorapeople.org/repos/openstack/openstack-kilo/testing/rdo-release-kilo-1.noarch.rpm | |
fi | |
if ! rpm -q epel-release; then | |
sudo yum install -y http://mirrors.einstein.yu.edu/epel/7/x86_64/e/epel-release-7-5.noarch.rpm | |
fi | |
if $(grep -Eqs 'Red Hat Enterprise Linux Server' /etc/redhat-release); then | |
export RUN_RHOS_RELEASE=${RUN_RHOS_RELEASE:-"0"} | |
# rhos-release is also required, otherwise we have no base RHEL repositories to | |
# pull any dependencies from (without using subscription-manager anyway). | |
if [ "$RUN_RHOS_RELEASE" = "1" ]; then | |
if rpm -q rhos-release; then | |
sudo yum remove -y rhos-release | |
fi | |
sudo yum install -y http://rhos-release.virt.bos.redhat.com/repos/rhos-release/rhos-release-latest.noarch.rpm | |
sudo rhos-release 6 | |
# We need openwsman-python from the optional repo | |
sudo yum install -y yum-utils | |
sudo yum-config-manager --enable rhelosp-rhel-7-server-opt | |
fi | |
fi | |
# Delorean uses repo priorities to ensure we get the right packages | |
sudo yum install -y yum-plugin-priorities |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment