Paul Bourke 897337cdd6 Symlink all non Dockerfile resources in images
The only files in the docker image directories that differ majorly between
distros are the Dockerfiles (e.g. different package manager mechanisms,
different repo sources, etc).

The supporting files such as the start.sh/check.sh and config files should
largely stay the same between base images.

This change moves these files up into a "common" directory, and symlinks them
in the same way that the build script is managed. This means when adding a new
base distro only new Dockerfiles need to be created. Also, if a distro does
happen to require a vastly different start.sh script for example, one can
choose to simply not symlink to the common and instead drop in a custom one.

Implements: blueprint refactor-base-image-layout

Change-Id: Ic4db69d31ff54a1fb95af4853a2e5ae490064284
2015-06-19 17:12:05 +00:00

47 lines
2.1 KiB
Bash
Executable File

#!/bin/bash
set -e
. /opt/kolla/kolla-common.sh
check_required_vars MAGNUM_DB_PASSWORD MAGNUM_KEYSTONE_PASSWORD \
KEYSTONE_PUBLIC_SERVICE_HOST KEYSTONE_PUBLIC_SERVICE_PORT \
MAGNUM_KEYSTONE_USER ADMIN_TENANT_NAME \
MAGNUM_DB_USER MAGNUM_DB_NAME KEYSTONE_AUTH_PROTOCOL \
KEYSTONE_PUBLIC_SERVICE_PORT RABBITMQ_SERVICE_HOST \
VERBOSE_LOGGING DEBUG_LOGGING
fail_unless_db
dump_vars
cat > /openrc <<EOF
export OS_AUTH_URL="http://${KEYSTONE_PUBLIC_SERVICE_HOST}:${KEYSTONE_PUBLIC_SERVICE_PORT}/v2.0"
export OS_USERNAME="${MAGNUM_KEYSTONE_USER}"
export OS_PASSWORD="${MAGNUM_KEYSTONE_PASSWORD}"
export OS_TENANT_NAME="${ADMIN_TENANT_NAME}"
EOF
cfg=/etc/magnum/magnum.conf
crudini --set $cfg DEFAULT log_file ""
crudini --set $cfg DEFAULT verbose "${VERBOSE_LOGGING}"
crudini --set $cfg DEFAULT debug "${DEBUG_LOGGING}"
crudini --set $cfg DEFAULT use_stderr true
crudini --set $cfg DEFAULT rpc_backend magnum.openstack.common.rpc.impl_kombu
crudini --set $cfg DEFAULT admin_user admin
crudini --set $cfg oslo_messaging_rabbit rabbit_host ${RABBITMQ_SERVICE_HOST}
crudini --set $cfg oslo_messaging_rabbit rabbit_userid ${RABBIT_USER}
crudini --set $cfg oslo_messaging_rabbit rabbit_password ${RABBIT_PASSWORD}
crudini --set $cfg database connection \
mysql://${MAGNUM_DB_USER}:${MAGNUM_DB_PASSWORD}@${MARIADB_SERVICE_HOST}/${MAGNUM_DB_NAME}
crudini --set $cfg keystone_authtoken auth_protocol "${KEYSTONE_AUTH_PROTOCOL}"
crudini --set $cfg keystone_authtoken auth_host "${KEYSTONE_PUBLIC_SERVICE_HOST}"
crudini --set $cfg keystone_authtoken auth_port "${KEYSTONE_PUBLIC_SERVICE_PORT}"
crudini --set $cfg keystone_authtoken auth_uri \
"${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_PUBLIC_SERVICE_HOST}:${KEYSTONE_PUBLIC_SERVICE_PORT}/v2.0"
crudini --set $cfg keystone_authtoken admin_tenant_name "${ADMIN_TENANT_NAME}"
crudini --set $cfg keystone_authtoken admin_user "${MAGNUM_KEYSTONE_USER}"
crudini --set $cfg keystone_authtoken admin_password \
"${MAGNUM_KEYSTONE_PASSWORD}"
crudini --set $cfg api host ${MAGNUM_API_SERVICE_HOST}