aboutsummaryrefslogtreecommitdiff
path: root/docker/common/heat/heat-api
diff options
context:
space:
mode:
authorHarm Weites <harm@weites.com>2015-07-02 21:15:14 +0200
committerHarm Weites <harm@weites.com>2015-07-02 21:16:45 +0200
commitb07bb59c2d0ec5c8f2d3fd36a7c85e3d63bb31f3 (patch)
treec721a9e88144fdab491096ff8c098ffafa47fbea /docker/common/heat/heat-api
parent3a4500c1220f11aa01faabf3ae4e74b6697861c0 (diff)
downloadkolla-b07bb59c2d0ec5c8f2d3fd36a7c85e3d63bb31f3.tar.gz
kolla-b07bb59c2d0ec5c8f2d3fd36a7c85e3d63bb31f3.zip
Add config-internal/config-external to Heat containers
Partially Implements: Blueprint standard-start Change-Id: Ia353ea4292e1f183949e8fc1c68ed345d1edc884
Diffstat (limited to 'docker/common/heat/heat-api')
-rwxr-xr-xdocker/common/heat/heat-api/config-external.sh10
-rwxr-xr-xdocker/common/heat/heat-api/config-internal.sh29
-rwxr-xr-xdocker/common/heat/heat-api/start.sh32
3 files changed, 47 insertions, 24 deletions
diff --git a/docker/common/heat/heat-api/config-external.sh b/docker/common/heat/heat-api/config-external.sh
new file mode 100755
index 000000000..ca5d73e90
--- /dev/null
+++ b/docker/common/heat/heat-api/config-external.sh
@@ -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
diff --git a/docker/common/heat/heat-api/config-internal.sh b/docker/common/heat/heat-api/config-internal.sh
new file mode 100755
index 000000000..b57aaa710
--- /dev/null
+++ b/docker/common/heat/heat-api/config-internal.sh
@@ -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
diff --git a/docker/common/heat/heat-api/start.sh b/docker/common/heat/heat-api/start.sh
index b57aaa710..6dd14d17e 100755
--- a/docker/common/heat/heat-api/start.sh
+++ b/docker/common/heat/heat-api/start.sh
@@ -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