Merge "Updates to glance start scripts, db and user/role creation - adding db sync and db creation as utf8 - fixing user and role creation"

This commit is contained in:
Jenkins 2014-10-03 20:48:59 +00:00 committed by Gerrit Code Review
commit 9ce465d544
2 changed files with 26 additions and 26 deletions

View File

@ -52,4 +52,3 @@ crudini --set $cfg \
connection \ connection \
"mysql://${GLANCE_DB_USER}:${GLANCE_DB_PASSWORD}@${MARIADBMASTER_PORT_3306_TCP_ADDR}:${MARIADBMASTER_PORT_3306_TCP_PORT}/${GLANCE_DB_NAME}" "mysql://${GLANCE_DB_USER}:${GLANCE_DB_PASSWORD}@${MARIADBMASTER_PORT_3306_TCP_ADDR}:${MARIADBMASTER_PORT_3306_TCP_PORT}/${GLANCE_DB_NAME}"

View File

@ -4,7 +4,7 @@
: ${GLANCE_DB_NAME:=glance} : ${GLANCE_DB_NAME:=glance}
: ${KEYSTONE_AUTH_PROTOCOL:=http} : ${KEYSTONE_AUTH_PROTOCOL:=http}
: ${GLANCE_KEYSTONE_USER:=glance} : ${GLANCE_KEYSTONE_USER:=glance}
: ${ADMIN_TENANT_NAME:=admin} : ${GLANCE_TENANT_NAME:=services}
if ! [ "$KEYSTONE_ADMIN_TOKEN" ]; then if ! [ "$KEYSTONE_ADMIN_TOKEN" ]; then
echo "*** Missing KEYSTONE_ADMIN_TOKEN" >&2 echo "*** Missing KEYSTONE_ADMIN_TOKEN" >&2
@ -23,18 +23,19 @@ fi
sh /opt/glance/config-glance.sh registry sh /opt/glance/config-glance.sh registry
mysql -h ${MARIADBMASTER_PORT_3306_TCP_ADDR} -u root \ mysql -h ${MARIADBMASTER_PORT_3306_TCP_ADDR} -u root -p${DB_ROOT_PASSWORD} mysql <<EOF
-p${DB_ROOT_PASSWORD} mysql <<EOF CREATE DATABASE IF NOT EXISTS ${GLANCE_DB_NAME} DEFAULT CHARACTER SET utf8;
CREATE DATABASE IF NOT EXISTS ${GLANCE_DB_NAME}; GRANT ALL PRIVILEGES ON ${GLANCE_DB_NAME}.* TO
GRANT ALL PRIVILEGES ON glance* TO
'${GLANCE_DB_USER}'@'%' IDENTIFIED BY '${GLANCE_DB_PASSWORD}' '${GLANCE_DB_USER}'@'%' IDENTIFIED BY '${GLANCE_DB_PASSWORD}'
EOF EOF
/usr/bin/glance-manage db_sync
export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}" export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}"
export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONEMASTER_35357_PORT_35357_TCP_ADDR}:35357/v2.0" export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONEMASTER_35357_PORT_35357_TCP_ADDR}:35357/v2.0"
/bin/keystone user-create --name ${GLANCE_KEYSTONE_USER} --pass ${GLANCE_ADMIN_PASSWORD} /usr/bin/keystone user-create --name ${GLANCE_KEYSTONE_USER} --pass ${GLANCE_KEYSTONE_PASS}
/bin/keystone role-create --name ${GLANCE_KEYSTONE_USER} /usr/bin/keystone user-role-add --user ${GLANCE_KEYSTONE_USER} --role admin --tenant ${GLANCE_TENANT_NAME}
/bin/keystone user-role-add --user ${GLANCE_KEYSTONE_USER} --role admin --tenant ${ADMIN_TENANT_NAME}
exec /usr/bin/glance-registry exec /usr/bin/glance-registry