Add config-internal/config-external to Heat containers
Partially Implements: Blueprint standard-start Change-Id: Ia353ea4292e1f183949e8fc1c68ed345d1edc884
This commit is contained in:
parent
3a4500c122
commit
b07bb59c2d
@ -9,4 +9,6 @@ RUN yum -y install \
|
||||
ADD ./start.sh /start.sh
|
||||
ADD ./check.sh /check.sh
|
||||
|
||||
COPY config-internal.sh config-external.sh /opt/kolla/
|
||||
|
||||
CMD ["/start.sh"]
|
||||
|
1
docker/centos/binary/heat/heat-api-cfn/config-external.sh
Symbolic link
1
docker/centos/binary/heat/heat-api-cfn/config-external.sh
Symbolic link
@ -0,0 +1 @@
|
||||
../../../../common/heat/heat-api-cfn/config-external.sh
|
1
docker/centos/binary/heat/heat-api-cfn/config-internal.sh
Symbolic link
1
docker/centos/binary/heat/heat-api-cfn/config-internal.sh
Symbolic link
@ -0,0 +1 @@
|
||||
../../../../common/heat/heat-api-cfn/config-internal.sh
|
@ -11,4 +11,6 @@ RUN yum -y install \
|
||||
ADD ./start.sh /start.sh
|
||||
ADD ./check.sh /check.sh
|
||||
|
||||
COPY config-internal.sh config-external.sh /opt/kolla/
|
||||
|
||||
CMD ["/start.sh"]
|
||||
|
1
docker/centos/binary/heat/heat-api/config-external.sh
Symbolic link
1
docker/centos/binary/heat/heat-api/config-external.sh
Symbolic link
@ -0,0 +1 @@
|
||||
../../../../common/heat/heat-api/config-external.sh
|
1
docker/centos/binary/heat/heat-api/config-internal.sh
Symbolic link
1
docker/centos/binary/heat/heat-api/config-internal.sh
Symbolic link
@ -0,0 +1 @@
|
||||
../../../../common/heat/heat-api/config-internal.sh
|
@ -10,4 +10,7 @@ RUN yum -y install \
|
||||
&& yum clean all
|
||||
|
||||
ADD ./start.sh /start.sh
|
||||
|
||||
COPY config-internal.sh config-external.sh /opt/kolla/
|
||||
|
||||
CMD ["/start.sh"]
|
||||
|
1
docker/centos/binary/heat/heat-engine/config-external.sh
Symbolic link
1
docker/centos/binary/heat/heat-engine/config-external.sh
Symbolic link
@ -0,0 +1 @@
|
||||
../../../../common/heat/heat-engine/config-external.sh
|
1
docker/centos/binary/heat/heat-engine/config-internal.sh
Symbolic link
1
docker/centos/binary/heat/heat-engine/config-internal.sh
Symbolic link
@ -0,0 +1 @@
|
||||
../../../../common/heat/heat-engine/config-internal.sh
|
10
docker/common/heat/heat-api-cfn/config-external.sh
Executable file
10
docker/common/heat/heat-api-cfn/config-external.sh
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
SOURCE="/opt/kolla/heat-api-cfn/heat.conf"
|
||||
TARGET="/etc/heat/heat.conf"
|
||||
OWNER="heat"
|
||||
|
||||
if [[ -f "$SOURCE" ]]; then
|
||||
cp $SOURCE $TARGET
|
||||
chown ${OWNER}: $TARGET
|
||||
chmod 0644 $TARGET
|
||||
fi
|
28
docker/common/heat/heat-api-cfn/config-internal.sh
Executable file
28
docker/common/heat/heat-api-cfn/config-internal.sh
Executable file
@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
. /opt/kolla/kolla-common.sh
|
||||
. /opt/kolla/config-heat.sh
|
||||
|
||||
check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_ADMIN_SERVICE_HOST \
|
||||
HEAT_CFN_KEYSTONE_USER HEAT_CFN_KEYSTONE_PASSWORD \
|
||||
KEYSTONE_AUTH_PROTOCOL KEYSTONE_ADMIN_SERVICE_PORT \
|
||||
ADMIN_TENANT_NAME HEAT_API_CFN_SERVICE_HOST \
|
||||
HEAT_API_CFN_SERVICE_PORT
|
||||
|
||||
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 -n ${HEAT_CFN_KEYSTONE_USER} \
|
||||
-p ${HEAT_CFN_KEYSTONE_PASSWORD} \
|
||||
-t ${ADMIN_TENANT_NAME} \
|
||||
-r admin
|
||||
|
||||
crux endpoint-create --remove-all -n ${HEAT_CFN_KEYSTONE_USER} -t cloudformation \
|
||||
-I "${KEYSTONE_AUTH_PROTOCOL}://${HEAT_API_CFN_SERVICE_HOST}:${HEAT_API_CFN_SERVICE_PORT}/v1" \
|
||||
-P "${KEYSTONE_AUTH_PROTOCOL}://${HEAT_API_CFN_SERVICE_HOST}:${HEAT_API_CFN_SERVICE_PORT}/v1" \
|
||||
-A "${KEYSTONE_AUTH_PROTOCOL}://${HEAT_API_CFN_SERVICE_HOST}:${HEAT_API_CFN_SERVICE_PORT}/v1"
|
||||
|
||||
exec /usr/bin/heat-api-cfn
|
@ -1,28 +1,13 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
set -o errexit
|
||||
|
||||
. /opt/kolla/kolla-common.sh
|
||||
. /opt/kolla/config-heat.sh
|
||||
CMD="/usr/bin/heat-api-cfn"
|
||||
ARGS=""
|
||||
|
||||
check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_ADMIN_SERVICE_HOST \
|
||||
HEAT_CFN_KEYSTONE_USER HEAT_CFN_KEYSTONE_PASSWORD \
|
||||
KEYSTONE_AUTH_PROTOCOL KEYSTONE_ADMIN_SERVICE_PORT \
|
||||
ADMIN_TENANT_NAME HEAT_API_CFN_SERVICE_HOST \
|
||||
HEAT_API_CFN_SERVICE_PORT
|
||||
# Loading common functions.
|
||||
source /opt/kolla/kolla-common.sh
|
||||
|
||||
fail_unless_os_service_running keystone
|
||||
# Config-internal script exec out of this function, it does not return here.
|
||||
set_configs
|
||||
|
||||
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 -n ${HEAT_CFN_KEYSTONE_USER} \
|
||||
-p ${HEAT_CFN_KEYSTONE_PASSWORD} \
|
||||
-t ${ADMIN_TENANT_NAME} \
|
||||
-r admin
|
||||
|
||||
crux endpoint-create --remove-all -n ${HEAT_CFN_KEYSTONE_USER} -t cloudformation \
|
||||
-I "${KEYSTONE_AUTH_PROTOCOL}://${HEAT_API_CFN_SERVICE_HOST}:${HEAT_API_CFN_SERVICE_PORT}/v1" \
|
||||
-P "${KEYSTONE_AUTH_PROTOCOL}://${HEAT_API_CFN_SERVICE_HOST}:${HEAT_API_CFN_SERVICE_PORT}/v1" \
|
||||
-A "${KEYSTONE_AUTH_PROTOCOL}://${HEAT_API_CFN_SERVICE_HOST}:${HEAT_API_CFN_SERVICE_PORT}/v1"
|
||||
|
||||
exec /usr/bin/heat-api-cfn
|
||||
exec $CMD $ARGS
|
||||
|
10
docker/common/heat/heat-api/config-external.sh
Executable file
10
docker/common/heat/heat-api/config-external.sh
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
SOURCE="/opt/kolla/heat-api/heat-api.conf"
|
||||
TARGET="/etc/heat/heat-api.conf"
|
||||
OWNER="heat"
|
||||
|
||||
if [[ -f "$SOURCE" ]]; then
|
||||
cp $SOURCE $TARGET
|
||||
chown ${OWNER}: $TARGET
|
||||
chmod 0644 $TARGET
|
||||
fi
|
29
docker/common/heat/heat-api/config-internal.sh
Executable file
29
docker/common/heat/heat-api/config-internal.sh
Executable file
@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
. /opt/kolla/kolla-common.sh
|
||||
. /opt/kolla/config-heat.sh
|
||||
|
||||
check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_ADMIN_SERVICE_HOST \
|
||||
HEAT_KEYSTONE_USER HEAT_KEYSTONE_PASSWORD \
|
||||
KEYSTONE_AUTH_PROTOCOL ADMIN_TENANT_NAME \
|
||||
HEAT_API_SERVICE_HOST PUBLIC_IP
|
||||
|
||||
fail_unless_os_service_running keystone
|
||||
|
||||
export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}"
|
||||
export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_SERVICE_HOST}:35357/v2.0"
|
||||
crux user-create -n ${HEAT_KEYSTONE_USER} \
|
||||
-p ${HEAT_KEYSTONE_PASSWORD} \
|
||||
-t ${ADMIN_TENANT_NAME} \
|
||||
-r admin
|
||||
|
||||
crux endpoint-create --remove-all -n ${HEAT_KEYSTONE_USER} -t orchestration \
|
||||
-I "${KEYSTONE_AUTH_PROTOCOL}://${HEAT_API_SERVICE_HOST}:8004/v1/%(tenant_id)s" \
|
||||
-P "${KEYSTONE_AUTH_PROTOCOL}://${PUBLIC_IP}:8004/v1/%(tenant_id)s" \
|
||||
-A "${KEYSTONE_AUTH_PROTOCOL}://${HEAT_API_SERVICE_HOST}:8004/v1/%(tenant_id)s"
|
||||
|
||||
# will use crux after https://github.com/larsks/crux/issues/1 is implemented
|
||||
openstack role list --os-token="${KEYSTONE_ADMIN_TOKEN}" --os-url $SERVICE_ENDPOINT -f csv | tail -n +2 | awk -F, '{print $2}' | grep heat_stack_user || keystone role-create --name heat_stack_user
|
||||
|
||||
exec /usr/bin/heat-api
|
@ -1,29 +1,13 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
set -o errexit
|
||||
|
||||
. /opt/kolla/kolla-common.sh
|
||||
. /opt/kolla/config-heat.sh
|
||||
CMD="/usr/bin/heat-api"
|
||||
ARGS=""
|
||||
|
||||
check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_ADMIN_SERVICE_HOST \
|
||||
HEAT_KEYSTONE_USER HEAT_KEYSTONE_PASSWORD \
|
||||
KEYSTONE_AUTH_PROTOCOL ADMIN_TENANT_NAME \
|
||||
HEAT_API_SERVICE_HOST PUBLIC_IP
|
||||
# Loading common functions.
|
||||
source /opt/kolla/kolla-common.sh
|
||||
|
||||
fail_unless_os_service_running keystone
|
||||
# Config-internal script exec out of this function, it does not return here.
|
||||
set_configs
|
||||
|
||||
export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}"
|
||||
export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_SERVICE_HOST}:35357/v2.0"
|
||||
crux user-create -n ${HEAT_KEYSTONE_USER} \
|
||||
-p ${HEAT_KEYSTONE_PASSWORD} \
|
||||
-t ${ADMIN_TENANT_NAME} \
|
||||
-r admin
|
||||
|
||||
crux endpoint-create --remove-all -n ${HEAT_KEYSTONE_USER} -t orchestration \
|
||||
-I "${KEYSTONE_AUTH_PROTOCOL}://${HEAT_API_SERVICE_HOST}:8004/v1/%(tenant_id)s" \
|
||||
-P "${KEYSTONE_AUTH_PROTOCOL}://${PUBLIC_IP}:8004/v1/%(tenant_id)s" \
|
||||
-A "${KEYSTONE_AUTH_PROTOCOL}://${HEAT_API_SERVICE_HOST}:8004/v1/%(tenant_id)s"
|
||||
|
||||
# will use crux after https://github.com/larsks/crux/issues/1 is implemented
|
||||
openstack role list --os-token="${KEYSTONE_ADMIN_TOKEN}" --os-url $SERVICE_ENDPOINT -f csv | tail -n +2 | awk -F, '{print $2}' | grep heat_stack_user || keystone role-create --name heat_stack_user
|
||||
|
||||
exec /usr/bin/heat-api
|
||||
exec $CMD $ARGS
|
||||
|
10
docker/common/heat/heat-engine/config-external.sh
Executable file
10
docker/common/heat/heat-engine/config-external.sh
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
SOURCE="/opt/kolla/heat-engine/heat.conf"
|
||||
TARGET="/etc/heat/heat.conf"
|
||||
OWNER="heat"
|
||||
|
||||
if [[ -f "$SOURCE" ]]; then
|
||||
cp $SOURCE $TARGET
|
||||
chown ${OWNER}: $TARGET
|
||||
chmod 0644 $TARGET
|
||||
fi
|
28
docker/common/heat/heat-engine/config-internal.sh
Executable file
28
docker/common/heat/heat-engine/config-internal.sh
Executable file
@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
|
||||
. /opt/kolla/kolla-common.sh
|
||||
. /opt/kolla/config-heat.sh
|
||||
. /openrc
|
||||
|
||||
check_required_vars HEAT_DB_NAME HEAT_DB_USER HEAT_DB_PASSWORD \
|
||||
INIT_HEAT_DB HEAT_DOMAIN_PASS
|
||||
fail_unless_db
|
||||
|
||||
if [ "${INIT_HEAT_DB}" == "true" ]; then
|
||||
mysql -h ${MARIADB_SERVICE_HOST} -u root -p${DB_ROOT_PASSWORD} mysql <<EOF
|
||||
CREATE DATABASE IF NOT EXISTS ${HEAT_DB_NAME} DEFAULT CHARACTER SET utf8;
|
||||
GRANT ALL PRIVILEGES ON ${HEAT_DB_NAME}.* TO
|
||||
'${HEAT_DB_USER}'@'%' IDENTIFIED BY '${HEAT_DB_PASSWORD}'
|
||||
EOF
|
||||
|
||||
/usr/bin/heat-manage db_sync
|
||||
|
||||
# If the database needs to be created, assume keystone-setup is allowed to
|
||||
# run as well.
|
||||
heat-keystone-setup-domain \
|
||||
--stack-user-domain-name heat_user_domain \
|
||||
--stack-domain-admin heat_domain_admin \
|
||||
--stack-domain-admin-password ${HEAT_DOMAIN_PASS}
|
||||
fi
|
||||
|
||||
exec /usr/bin/heat-engine
|
@ -1,28 +1,20 @@
|
||||
#!/bin/bash
|
||||
set -o errexit
|
||||
|
||||
. /opt/kolla/kolla-common.sh
|
||||
. /opt/kolla/config-heat.sh
|
||||
. /openrc
|
||||
CMD="/usr/bin/heat-engine"
|
||||
ARGS=""
|
||||
|
||||
check_required_vars HEAT_DB_NAME HEAT_DB_USER HEAT_DB_PASSWORD \
|
||||
INIT_HEAT_DB HEAT_DOMAIN_PASS
|
||||
fail_unless_db
|
||||
# Loading common functions.
|
||||
source /opt/kolla/kolla-common.sh
|
||||
|
||||
if [ "${INIT_HEAT_DB}" == "true" ]; then
|
||||
mysql -h ${MARIADB_SERVICE_HOST} -u root -p${DB_ROOT_PASSWORD} mysql <<EOF
|
||||
CREATE DATABASE IF NOT EXISTS ${HEAT_DB_NAME} DEFAULT CHARACTER SET utf8;
|
||||
GRANT ALL PRIVILEGES ON ${HEAT_DB_NAME}.* TO
|
||||
'${HEAT_DB_USER}'@'%' IDENTIFIED BY '${HEAT_DB_PASSWORD}'
|
||||
EOF
|
||||
# Config-internal script exec out of this function, it does not return here.
|
||||
set_configs
|
||||
|
||||
/usr/bin/heat-manage db_sync
|
||||
|
||||
# If the database needs to be created, assume keystone-setup is allowed to
|
||||
# run as well.
|
||||
heat-keystone-setup-domain \
|
||||
--stack-user-domain-name heat_user_domain \
|
||||
--stack-domain-admin heat_domain_admin \
|
||||
--stack-domain-admin-password ${HEAT_DOMAIN_PASS}
|
||||
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
|
||||
# of the KOLLA_BOOTSTRAP variable being set, including empty.
|
||||
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
|
||||
su -s /bin/bash -c "/usr/bin/heat-manage db_sync" heat
|
||||
exit 0
|
||||
fi
|
||||
|
||||
exec /usr/bin/heat-engine
|
||||
exec $CMD $ARGS
|
||||
|
Loading…
Reference in New Issue
Block a user