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
This commit is contained in:
Ryan Hallisey 2014-10-14 13:11:10 +00:00
parent cd13790136
commit 15cc9c4f5d

View File

@ -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}