Merge "correct various issues with glance images and configs"

This commit is contained in:
Jenkins 2014-10-13 15:02:26 +00:00 committed by Gerrit Code Review
commit 866ff0d590
4 changed files with 97 additions and 75 deletions

View File

@ -10,14 +10,19 @@ fi
export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}"
export SERVICE_ENDPOINT="http://${KEYSTONE_ADMIN_PORT_35357_TCP_ADDR}:35357/v2.0"
crux user-create -n "${GLANCE_KEYSTONE_USER}" \
-p "${GLANCE_KEYSTONE_PASSWORD}" \
-t "${ADMIN_TENANT_NAME}" \
-r admin
while ! curl -o /dev/null -s --fail ${SERVICE_ENDPOINT}; do
echo "waiting for keystone..."
sleep 1;
done
crux endpoint-create -n glance -t image \
-I "http://${GLANCE_API_PORT_9292_TCP_ADDR}:9292" \
-P "http://${PUBLIC_IP}:9292" \
-A "http://${GLANCE_API_PORT_9292_TCP_ADDR}:9292"
crux user-create --update -n "${GLANCE_KEYSTONE_USER}" \
-p "${GLANCE_KEYSTONE_PASSWORD}" \
-t "${ADMIN_TENANT_NAME}" \
-r admin
crux endpoint-create --remove-all -n glance -t image \
-I "http://${GLANCE_API_PORT_9292_TCP_ADDR}:9292" \
-P "http://${PUBLIC_IP}:9292" \
-A "http://${GLANCE_API_PORT_9292_TCP_ADDR}:9292"
exec /usr/bin/glance-api

View File

@ -14,14 +14,14 @@ MY_IP=$(ip route get $(ip route | awk '$1 == "default" {print $3}') |
: ${KEYSTONE_AUTH_PROTOCOL:=http}
: ${PUBLIC_IP:=$MY_IP}
if ! [ "$GLANCE_DB_PASSWORD" ]; then
GLANCE_DB_PASSWORD=$(openssl rand -hex 15)
export GLANCE_DB_PASSWORD
if [ -z "$GLANCE_DB_PASSWORD" ]; then
echo "ERROR: missing GLANCE_DB_PASSWORD" >&2
exit 1
fi
if ! [ "$GLANCE_KEYSTONE_PASSWORD" ]; then
GLANCE_KEYSTONE_PASSWORD=$(openssl rand -hex 15)
export GLANCE_KEYSTONE_PASSWORD
if [ -z "$GLANCE_KEYSTONE_PASSWORD" ]; then
echo "ERROR: missing GLANCE_KEYSTONE_PASSWORD" >&2
exit 1
fi
if ! [ -f /startconfig ]; then
@ -37,6 +37,13 @@ GLANCE_KEYSTONE_PASSWORD=${GLANCE_KEYSTONE_PASSWORD}
EOF
fi
cat > /openrc <<EOF
export OS_AUTH_URL="http://${KEYSTONE_PUBLIC_PORT_5000_TCP_ADDR}:5000/v2.0"
export OS_USERNAME="${GLANCE_KEYSTONE_USER}"
export OS_PASSWORD="${GLANCE_KEYSTONE_PASSWORD}"
export OS_TENANT_NAME="${ADMIN_TENANT_NAME}"
EOF
for cfg in /etc/glance/glance-api.conf /etc/glance/glance-registry.conf; do
crudini --del $cfg \
DEFAULT \
@ -48,10 +55,6 @@ for cfg in /etc/glance/glance-api.conf /etc/glance/glance-registry.conf; do
$option
done
crudini --set $cfg \
DEFAULT \
bind_host \
$MY_IP
crudini --set $cfg \
keystone_authtoken \
auth_uri \
@ -59,7 +62,7 @@ for cfg in /etc/glance/glance-api.conf /etc/glance/glance-registry.conf; do
crudini --set $cfg \
keystone_authtoken \
admin_tenant_name \
"${ADMIN_TENANT_NAME}"
"${ADMIN_TENANT_NAME}"
crudini --set $cfg \
keystone_authtoken \
admin_user \

View File

@ -2,6 +2,12 @@
. /opt/glance/config-glance.sh
# wait for mysql to start
while ! mysql -h ${MARIADB_PORT_3306_TCP_ADDR} -u root -p${DB_ROOT_PASSWORD} -e "select 1" mysql > /dev/null 2>&1; do
echo "waiting for mysql..."
sleep 1
done
mysql -h ${MARIADB_PORT_3306_TCP_ADDR} -u root -p${DB_ROOT_PASSWORD} mysql <<EOF
CREATE DATABASE IF NOT EXISTS ${GLANCE_DB_NAME} DEFAULT CHARACTER SET utf8;
GRANT ALL PRIVILEGES ON ${GLANCE_DB_NAME}.* TO

View File

@ -1,60 +1,68 @@
{
"desiredState": {
"manifest": {
"containers": [
{
"env": [
{
"name": "DB_ROOT_PASSWORD",
"value": "password"
},
{
"name": "GLANCE_DB_PASSWORD",
"value": "password"
},
{
"name": "KEYSTONE_ADMIN_TOKEN",
"value": "ADMINTOKEN"
}
],
"image": "kollaglue/fedora-rdo-glance-registry",
"name": "glance-registry",
"ports": [
{
"containerPort": 9191
}
]
},
{
"env": [
{
"name": "DB_ROOT_PASSWORD",
"value": "password"
},
{
"name": "GLANCE_DB_PASSWORD",
"value": "password"
},
{
"name": "KEYSTONE_ADMIN_TOKEN",
"value": "ADMINTOKEN"
}
],
"image": "kollaglue/fedora-rdo-glance-api",
"name": "glance-api",
"ports": [
{
"containerPort": 9292
}
]
}
],
"id": "glance-1",
"version": "v1beta1"
"labels": {
"name": "glance"
},
"id": "glance",
"desiredState": {
"manifest": {
"version": "v1beta1",
"id": "glance-1",
"containers": [
{
"ports": [
{
"containerPort": 9191
}
],
"name": "glance-registry",
"image": "kollaglue/fedora-rdo-glance-registry",
"env": [
{
"value": "password",
"name": "DB_ROOT_PASSWORD"
},
{
"value": "password",
"name": "GLANCE_DB_PASSWORD"
},
{
"value": "password",
"name": "GLANCE_KEYSTONE_PASSWORD"
},
{
"value": "ADMINTOKEN",
"name": "KEYSTONE_ADMIN_TOKEN"
}
]
},
{
"ports": [
{
"containerPort": 9292
}
],
"name": "glance-api",
"image": "kollaglue/fedora-rdo-glance-api",
"env": [
{
"value": "password",
"name": "DB_ROOT_PASSWORD"
},
{
"value": "password",
"name": "GLANCE_DB_PASSWORD"
},
{
"value": "password",
"name": "GLANCE_KEYSTONE_PASSWORD"
},
{
"value": "ADMINTOKEN",
"name": "KEYSTONE_ADMIN_TOKEN"
}
]
}
},
"id": "glance",
"labels": {
"name": "glance"
]
}
}
}