#!/bin/bash # # This script can be used to interact with kolla. if [[ $EUID -ne 0 ]]; then echo "You must execute this script as root." 1>&2 exit 1 fi # Move to top level directory REAL_PATH=$(python -c "import os,sys;print os.path.realpath('$0')") cd "$(dirname "$REAL_PATH")/.." NETWORK_MANAGER=$(grep -sri NETWORK_MANAGER ./compose/openstack.env | cut -f2 -d'=') if [[ -z "$NETWORK_MANAGER" ]]; then echo 'No network manager defined in ./compose/openstack.env, defaulting to "neutron".' NETWORK_MANAGER="neutron" fi function process { local service=$1 echo "$ACTION $service" docker-compose -f ./compose/${service}.yml $COMPOSE_CMD if [[ $? -ne 0 ]]; then echo "Call docker-compose -f ./compose/${service}.yml $COMPOSE_CMD fail." exit 1 fi } function process_all { process rabbitmq process mariadb process keystone process glance-api-registry process nova-api-conductor-scheduler-consoleauth-novncproxy if [[ "${NETWORK_MANAGER}" == "nova" ]] ; then process nova-compute-network else # Defaulting to neutron process nova-compute process neutron-server process neutron-linuxbridge-agent process neutron-agents fi process heat-api-engine process magnum-api-conductor process horizon process cinder-api-scheduler process cinder-backup process cinder-volume } function check_selinux { # Check for SELinux in Enforcing mode and exit if found if [[ -x /usr/sbin/getenforce ]]; then if [[ $(/usr/sbin/getenforce) == "Enforcing" ]]; then echo "You must execute this script without SELinux enforcing mode." echo "Turn off SELinux enforcing mode by running:" echo "$ sudo setenforce permissive" exit 1 fi fi } function pre_start { check_selinux if [[ -r ./openrc ]]; then # Source openrc for commands source ./openrc else echo 'Could not find ./openrc; bootstrap your environment with "./tools/genenv".' exit 1 fi } function post_start { until keystone user-list | grep glance; do echo "Waiting for OpenStack services to become available" sleep 2 done sleep 3 echo Example Usage: echo source openrc # source keystone credentials echo Configure your environment once by running: echo tools/init-runonce } function usage { cat <