instack-undercloud/scripts/instack-install-undercloud
Richard Su 8f221d1974 Temporary RHEL package install fixes
* python-ironicclient is missing from installed repos
* remove tripleo-selinux-keepalived.te
2014-10-21 22:43:19 -07:00

103 lines
3.6 KiB
Bash
Executable File

#!/bin/bash
set -eu
mkdir -p ~/.instack
LOGFILE=~/.instack/install-undercloud.log
exec > >(tee $LOGFILE)
exec 2>&1
echo "Running $0"
export JSONFILE=${JSONFILE:-/usr/share/instack-undercloud/json-files/fedora-20-undercloud-packages.json}
export ELEMENTS_PATH=${ELEMENTS_PATH:-"\
/usr/share/tripleo-image-elements:\
/usr/share/diskimage-builder/elements:\
/usr/share/instack-undercloud"}
echo "Sourcing answers file from instack.answers..."
source ~/instack.answers
export DEPLOYMENT_MODE
export IMAGE_PATH
export LOCAL_IP
export DNSMASQ_START
export DNSMASQ_END
export LOCAL_INTERFACE
export MASQUERADE_NETWORK
export POWER_DRIVER
export VIRTUAL_POWER_USER
export VIRTUAL_POWER_HOST
export DHCP_START
export DHCP_END
export NETWORK_CIDR
export NETWORK_GATEWAY
export DISCOVERY_INTERFACE
export DISCOVERY_IPRANGE
export DISCOVERY_PXEIP
export UNDERCLOUD_DB_PASSWORD=${UNDERCLOUD_DB_PASSWORD:-$(tripleo os-make-password)}
export UNDERCLOUD_ADMIN_TOKEN=${UNDERCLOUD_ADMIN_TOKEN:-$(tripleo os-make-password)}
export UNDERCLOUD_ADMIN_PASSWORD=${UNDERCLOUD_ADMIN_PASSWORD:-$(tripleo os-make-password)}
export UNDERCLOUD_GLANCE_PASSWORD=${UNDERCLOUD_GLANCE_PASSWORD:-$(tripleo os-make-password)}
export UNDERCLOUD_HEAT_PASSWORD=${UNDERCLOUD_HEAT_PASSWORD:-$(tripleo os-make-password)}
export UNDERCLOUD_NEUTRON_PASSWORD=${UNDERCLOUD_NEUTRON_PASSWORD:-$(tripleo os-make-password)}
export UNDERCLOUD_NOVA_PASSWORD=${UNDERCLOUD_NOVA_PASSWORD:-$(tripleo os-make-password)}
export UNDERCLOUD_IRONIC_PASSWORD=${UNDERCLOUD_IRONIC_PASSWORD:-$(tripleo os-make-password)}
export UNDERCLOUD_TUSKAR_PASSWORD=${UNDERCLOUD_TUSKAR_PASSWORD:-$(tripleo os-make-password)}
export UNDERCLOUD_CEILOMETER_PASSWORD=${UNDERCLOUD_CEILOMETER_PASSWORD:-$(tripleo os-make-password)}
export UNDERCLOUD_CEILOMETER_SNMPD_PASSWORD=${UNDERCLOUD_CEILOMETER_SNMPD_PASSWORD:-$(tripleo os-make-password)}
export TUSKAR_ROLE_DIRECTORY=${TUSKAR_ROLE_DIRECTORY:-/usr/share/openstack-tripleo-heat-templates}
# Temporary RHEL fixes
if [ "$(grep "Fedora" /etc/redhat-release)" == "" ]; then
# python-ironicclient is missing from installed repos
sudo yum -y install https://kojipkgs.fedoraproject.org//packages/python-ironicclient/0.3.1/1.fc22/noarch/python-ironicclient-0.3.1-1.fc22.noarch.rpm
# remove tripleo-selinux-keepalived.te because it doesn't install on RHEL
# https://bugzilla.redhat.com/show_bug.cgi?id=1151647
sudo rm /usr/share/tripleo-image-elements/elements/selinux/custom-policies/tripleo-selinux-keepalived.te
fi
sudo -E instack \
-p $ELEMENTS_PATH \
-j $JSONFILE
RUN_ORC=${RUN_ORC:-"1"}
export INSTACK_ROOT=${INSTACK_ROOT:-""}
if [ "$RUN_ORC" = "1" ]; then
sudo INSTACK_ROOT=$INSTACK_ROOT IMAGE_PATH=$IMAGE_PATH os-refresh-config
# generate ssh authentication keys if they don't exist
if [ ! -f ~/.ssh/id_rsa ]; then
ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa
fi
command $(sudo cat /root/stackrc | xargs)
if ! nova keypair-show default 2>&1 1>/dev/null; then
tripleo user-config
fi
fi
export COMPLETION_MESSAGE=${COMPLETION_MESSAGE:-"\
#############################################################################
install-undercloud complete.
The file containing this installation's passwords is at
/root/tripleo-undercloud-passwords.
There is also a stackrc file at /root/stackrc.
These files are needed to interact with the OpenStack services, and should be
secured. For convenience, they can be copied to the current directory:
sudo cp /root/tripleo-undercloud-passwords .
sudo cp /root/stackrc .
#############################################################################"}
echo "$COMPLETION_MESSAGE"