Merge "Add config-internal/config-external to Glance containers"
This commit is contained in:
commit
1c5988e642
@ -4,4 +4,6 @@ MAINTAINER Kolla Project (https://launchpad.net/kolla)
|
|||||||
ADD ./start.sh /start.sh
|
ADD ./start.sh /start.sh
|
||||||
ADD ./check.sh /check.sh
|
ADD ./check.sh /check.sh
|
||||||
|
|
||||||
|
COPY config-internal.sh config-external.sh /opt/kolla/
|
||||||
|
|
||||||
CMD ["/start.sh"]
|
CMD ["/start.sh"]
|
||||||
|
1
docker/centos/binary/glance/glance-api/config-external.sh
Symbolic link
1
docker/centos/binary/glance/glance-api/config-external.sh
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../../../common/glance/glance-api/config-external.sh
|
1
docker/centos/binary/glance/glance-api/config-internal.sh
Symbolic link
1
docker/centos/binary/glance/glance-api/config-internal.sh
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../../../common/glance/glance-api/config-internal.sh
|
@ -1,5 +1,7 @@
|
|||||||
FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%glance-base:%%KOLLA_TAG%%
|
FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%glance-base:%%KOLLA_TAG%%
|
||||||
MAINTAINER Kolla Project (https://launchpad.net/kolla)
|
MAINTAINER Kolla Project (https://launchpad.net/kolla)
|
||||||
|
|
||||||
|
COPY config-internal.sh config-external.sh /opt/kolla/
|
||||||
|
|
||||||
ADD ./start.sh /start.sh
|
ADD ./start.sh /start.sh
|
||||||
CMD ["/start.sh"]
|
CMD ["/start.sh"]
|
||||||
|
1
docker/centos/binary/glance/glance-registry/config-external.sh
Symbolic link
1
docker/centos/binary/glance/glance-registry/config-external.sh
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../../../common/glance/glance-registry/config-external.sh
|
1
docker/centos/binary/glance/glance-registry/config-internal.sh
Symbolic link
1
docker/centos/binary/glance/glance-registry/config-internal.sh
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../../../common/glance/glance-registry/config-internal.sh
|
10
docker/common/glance/glance-api/config-external.sh
Executable file
10
docker/common/glance/glance-api/config-external.sh
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
SOURCE="/opt/kolla/glance-api/glance-api.conf"
|
||||||
|
TARGET="/etc/glance/glance-api.conf"
|
||||||
|
OWNER="glance"
|
||||||
|
|
||||||
|
if [[ -f "$SOURCE" ]]; then
|
||||||
|
cp $SOURCE $TARGET
|
||||||
|
chown ${OWNER}: $TARGET
|
||||||
|
chmod 0644 $TARGET
|
||||||
|
fi
|
53
docker/common/glance/glance-api/config-internal.sh
Executable file
53
docker/common/glance/glance-api/config-internal.sh
Executable file
@ -0,0 +1,53 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
. /opt/kolla/kolla-common.sh
|
||||||
|
. /opt/kolla/config-glance.sh
|
||||||
|
|
||||||
|
check_required_vars ADMIN_TENANT_NAME GLANCE_API_SERVICE_HOST \
|
||||||
|
GLANCE_KEYSTONE_PASSWORD GLANCE_KEYSTONE_USER \
|
||||||
|
GLANCE_REGISTRY_SERVICE_HOST KEYSTONE_ADMIN_SERVICE_HOST \
|
||||||
|
KEYSTONE_ADMIN_SERVICE_PORT KEYSTONE_ADMIN_TOKEN \
|
||||||
|
KEYSTONE_AUTH_PROTOCOL PUBLIC_IP \
|
||||||
|
RABBITMQ_SERVICE_HOST
|
||||||
|
|
||||||
|
fail_unless_os_service_running keystone
|
||||||
|
|
||||||
|
export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}"
|
||||||
|
export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_SERVICE_HOST}:${KEYSTONE_ADMIN_SERVICE_PORT}/v2.0"
|
||||||
|
|
||||||
|
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_SERVICE_HOST}:9292" \
|
||||||
|
-P "http://${PUBLIC_IP}:9292" \
|
||||||
|
-A "http://${GLANCE_API_SERVICE_HOST}:9292"
|
||||||
|
|
||||||
|
# turn on notification sending by glance
|
||||||
|
crudini --set /etc/glance/glance-api.conf \
|
||||||
|
DEFAULT \
|
||||||
|
notification_driver \
|
||||||
|
"messaging"
|
||||||
|
|
||||||
|
crudini --set /etc/glance/glance-api.conf \
|
||||||
|
DEFAULT \
|
||||||
|
rabbit_host \
|
||||||
|
"${RABBITMQ_SERVICE_HOST}"
|
||||||
|
|
||||||
|
crudini --set /etc/glance/glance-api.conf \
|
||||||
|
DEFAULT \
|
||||||
|
registry_host \
|
||||||
|
"${GLANCE_REGISTRY_SERVICE_HOST}"
|
||||||
|
|
||||||
|
crudini --set /etc/glance/glance-api.conf \
|
||||||
|
DEFAULT \
|
||||||
|
debug \
|
||||||
|
"True"
|
||||||
|
|
||||||
|
exec /usr/bin/glance-api
|
@ -1,53 +1,13 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
set -o errexit
|
||||||
|
|
||||||
set -e
|
CMD="/usr/bin/glance-api"
|
||||||
|
ARGS=""
|
||||||
|
|
||||||
. /opt/kolla/kolla-common.sh
|
# Loading common functions.
|
||||||
. /opt/kolla/config-glance.sh
|
source /opt/kolla/kolla-common.sh
|
||||||
|
|
||||||
check_required_vars ADMIN_TENANT_NAME GLANCE_API_SERVICE_HOST \
|
# Config-internal script exec out of this function, it does not return here.
|
||||||
GLANCE_KEYSTONE_PASSWORD GLANCE_KEYSTONE_USER \
|
set_configs
|
||||||
GLANCE_REGISTRY_SERVICE_HOST KEYSTONE_ADMIN_SERVICE_HOST \
|
|
||||||
KEYSTONE_ADMIN_SERVICE_PORT KEYSTONE_ADMIN_TOKEN \
|
|
||||||
KEYSTONE_AUTH_PROTOCOL PUBLIC_IP \
|
|
||||||
RABBITMQ_SERVICE_HOST
|
|
||||||
|
|
||||||
fail_unless_os_service_running keystone
|
exec $CMD $ARGS
|
||||||
|
|
||||||
export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}"
|
|
||||||
export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_SERVICE_HOST}:${KEYSTONE_ADMIN_SERVICE_PORT}/v2.0"
|
|
||||||
|
|
||||||
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_SERVICE_HOST}:9292" \
|
|
||||||
-P "http://${PUBLIC_IP}:9292" \
|
|
||||||
-A "http://${GLANCE_API_SERVICE_HOST}:9292"
|
|
||||||
|
|
||||||
# turn on notification sending by glance
|
|
||||||
crudini --set /etc/glance/glance-api.conf \
|
|
||||||
DEFAULT \
|
|
||||||
notification_driver \
|
|
||||||
"messaging"
|
|
||||||
|
|
||||||
crudini --set /etc/glance/glance-api.conf \
|
|
||||||
DEFAULT \
|
|
||||||
rabbit_host \
|
|
||||||
"${RABBITMQ_SERVICE_HOST}"
|
|
||||||
|
|
||||||
crudini --set /etc/glance/glance-api.conf \
|
|
||||||
DEFAULT \
|
|
||||||
registry_host \
|
|
||||||
"${GLANCE_REGISTRY_SERVICE_HOST}"
|
|
||||||
|
|
||||||
crudini --set /etc/glance/glance-api.conf \
|
|
||||||
DEFAULT \
|
|
||||||
debug \
|
|
||||||
"True"
|
|
||||||
|
|
||||||
exec /usr/bin/glance-api
|
|
||||||
|
10
docker/common/glance/glance-registry/config-external.sh
Executable file
10
docker/common/glance/glance-registry/config-external.sh
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
SOURCE="/opt/kolla/glance-registry/glance-registry.conf"
|
||||||
|
TARGET="/etc/glance/glance-registry.conf"
|
||||||
|
OWNER="glance"
|
||||||
|
|
||||||
|
if [[ -f "$SOURCE" ]]; then
|
||||||
|
cp $SOURCE $TARGET
|
||||||
|
chown ${OWNER}: $TARGET
|
||||||
|
chmod 0644 $TARGET
|
||||||
|
fi
|
26
docker/common/glance/glance-registry/config-internal.sh
Executable file
26
docker/common/glance/glance-registry/config-internal.sh
Executable file
@ -0,0 +1,26 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
. /opt/kolla/kolla-common.sh
|
||||||
|
. /opt/kolla/config-glance.sh
|
||||||
|
|
||||||
|
|
||||||
|
check_required_vars DB_ROOT_PASSWORD GLANCE_DB_NAME \
|
||||||
|
GLANCE_DB_PASSWORD GLANCE_DB_USER \
|
||||||
|
MARIADB_SERVICE_HOST
|
||||||
|
# lets wait for the DB to be available
|
||||||
|
wait_for 25 1 check_for_db
|
||||||
|
|
||||||
|
if [ "${INIT_GLANCE_DB}" == "true" ]; then
|
||||||
|
mysql -h ${MARIADB_SERVICE_HOST} -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
|
||||||
|
'${GLANCE_DB_USER}'@'%' IDENTIFIED BY '${GLANCE_DB_PASSWORD}'
|
||||||
|
|
||||||
|
EOF
|
||||||
|
|
||||||
|
/usr/bin/glance-manage db_sync
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec /usr/bin/glance-registry
|
@ -1,26 +1,20 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
set -o errexit
|
||||||
|
|
||||||
set -e
|
CMD="/usr/bin/glance-registry"
|
||||||
|
ARGS=""
|
||||||
|
|
||||||
. /opt/kolla/kolla-common.sh
|
# Loading common functions.
|
||||||
. /opt/kolla/config-glance.sh
|
source /opt/kolla/kolla-common.sh
|
||||||
|
|
||||||
|
# Config-internal script exec out of this function, it does not return here.
|
||||||
|
set_configs
|
||||||
|
|
||||||
check_required_vars DB_ROOT_PASSWORD GLANCE_DB_NAME \
|
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
|
||||||
GLANCE_DB_PASSWORD GLANCE_DB_USER \
|
# of the KOLLA_BOOTSTRAP variable being set, including empty.
|
||||||
MARIADB_SERVICE_HOST
|
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
|
||||||
# lets wait for the DB to be available
|
su -s /bin/sh -c "glance-manage db_sync" glance
|
||||||
wait_for 25 1 check_for_db
|
exit 0
|
||||||
|
|
||||||
if [ "${INIT_GLANCE_DB}" == "true" ]; then
|
|
||||||
mysql -h ${MARIADB_SERVICE_HOST} -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
|
|
||||||
'${GLANCE_DB_USER}'@'%' IDENTIFIED BY '${GLANCE_DB_PASSWORD}'
|
|
||||||
|
|
||||||
EOF
|
|
||||||
|
|
||||||
/usr/bin/glance-manage db_sync
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec /usr/bin/glance-registry
|
exec $CMD $ARGS
|
||||||
|
Loading…
x
Reference in New Issue
Block a user