From 15cc9c4f5d8ca13ab464396532ccfc6415696670 Mon Sep 17 00:00:00 2001 From: Ryan Hallisey Date: Tue, 14 Oct 2014 13:11:10 +0000 Subject: [PATCH] Nova-controller needs a start script The nova-controller is going to make all the configurations so it needs a script to setup nova.conf. The config data is stored locally in nova.conf and will be read in and executed by line. Change-Id: Id501212671201ca68cd08018ce024db284dd8c54 --- .../nova-controller/nova-controller/start.sh | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 docker/nova-controller/nova-controller/start.sh diff --git a/docker/nova-controller/nova-controller/start.sh b/docker/nova-controller/nova-controller/start.sh new file mode 100644 index 0000000000..9078a71735 --- /dev/null +++ b/docker/nova-controller/nova-controller/start.sh @@ -0,0 +1,36 @@ +#!/bin/sh + +: ${NOVA_CONFIG:=nova.conf} +: ${NOVA_DB_USER:=nova} +: ${NOVA_DB_NAME:=nova} +: ${KEYSTONE_AUTH_PROTOCOL:=http} +: ${NOVA_KEYSTONE_USER:=admin} +: ${NOVA_ADMIN_PASSWORD:=kolla} +: ${ADMIN_TENANT_NAME:=admin} + +if ! [ "$KEYSTONE_ADMIN_TOKEN" ]; then + echo "*** Missing KEYSTONE_ADMIN_TOKEN" >&2 + exit 1 +fi + +if ! [ "$DB_ROOT_PASSWORD" ]; then + echo "*** Missing DB_ROOT_PASSWORD" >&2 + exit 1 +fi + +if ! [ "$NOVA_DB_PASSWORD" ]; then + NOVA_DB_PASSWORD=$(openssl rand -hex 15) + export NOVA_DB_PASSWORD +fi + +while read; do + LINE="$REPLY" + /bin/bash $LINE +done < $NOVA_CONFIG + +export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}" +export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONEMASTER_35357_PORT_35357_TCP_ADDR}:35357/v2.0" + +/usr/bin/keystone user-create --name ${NOVA_KEYSTONE_USER} --pass ${NOVA_ADMIN_PASSWORD} +/usr/bin/keystone role-create --name ${NOVA_KEYSTONE_USER} +/usr/bin/keystone user-role-add --user ${NOVA_KEYSTONE_USER} --role admin --tenant ${ADMIN_TENANT_NAME}