aboutsummaryrefslogtreecommitdiff
path: root/docker_templates
diff options
context:
space:
mode:
authorSteven Dake <stdake@cisco.com>2015-08-27 19:01:57 -0700
committerSteven Dake <stdake@cisco.com>2015-08-28 00:50:30 -0700
commiteef32f0353d5cee9b4bb876767aab5c8298375eb (patch)
treea4d1660805cc8aa848cf0d5c2949db734317a446 /docker_templates
parentc685119fec2faa6caab6706aaea25d696493b476 (diff)
downloadkolla-eef32f0353d5cee9b4bb876767aab5c8298375eb.tar.gz
kolla-eef32f0353d5cee9b4bb876767aab5c8298375eb.zip
Move scripts for rabbitmq to docker_templates
Change-Id: I6f06c067c18e4a3eafbed2b2796aa1cfe6c9b28c Partially-Implements: blueprint remove-docker-dir
Diffstat (limited to 'docker_templates')
-rw-r--r--[l---------]docker_templates/rabbitmq/config-external.sh20
-rw-r--r--[l---------]docker_templates/rabbitmq/config-rabbit.sh8
-rwxr-xr-x[l---------]docker_templates/rabbitmq/start.sh24
3 files changed, 49 insertions, 3 deletions
diff --git a/docker_templates/rabbitmq/config-external.sh b/docker_templates/rabbitmq/config-external.sh
index d0f0563db..33810d621 120000..100644
--- a/docker_templates/rabbitmq/config-external.sh
+++ b/docker_templates/rabbitmq/config-external.sh
@@ -1 +1,19 @@
-../../docker/common/rabbitmq/config-external.sh \ No newline at end of file
+#!/bin/bash
+SOURCE_CONFIG="/opt/kolla/rabbitmq/rabbitmq.config"
+TARGET_CONFIG="/etc/rabbitmq/rabbitmq.config"
+SOURCE_ENV="/opt/kolla/rabbitmq/rabbitmq-env.conf"
+TARGET_ENV="/etc/rabbitmq/rabbitmq-env.conf"
+OWNER="rabbitmq"
+
+# Cluster configuration
+if [[ -f "$SOURCE_CONFIG" ]]; then
+ cp -af $SOURCE_CONFIG $TARGET_CONFIG
+ chown ${OWNER}: $TARGET_CONFIG
+ chmod 0600 $TARGET_CONFIG
+fi
+
+if [[ -f "$SOURCE_ENV" ]]; then
+ cp -af $SOURCE_ENV $TARGET_ENV
+ chown ${OWNER}: $TARGET_ENV
+ chmod 0600 $TARGET_ENV
+fi
diff --git a/docker_templates/rabbitmq/config-rabbit.sh b/docker_templates/rabbitmq/config-rabbit.sh
index af4be1bf9..c87a2ab48 120000..100644
--- a/docker_templates/rabbitmq/config-rabbit.sh
+++ b/docker_templates/rabbitmq/config-rabbit.sh
@@ -1 +1,7 @@
-../../docker/common/rabbitmq/config-rabbit.sh \ No newline at end of file
+#!/bin/bash
+
+function set_rabbitmq_cookie {
+ echo "${RABBITMQ_CLUSTER_COOKIE}" > /var/lib/rabbitmq/.erlang.cookie
+ chown -R rabbitmq: /var/lib/rabbitmq
+ chmod 400 /var/lib/rabbitmq/.erlang.cookie
+}
diff --git a/docker_templates/rabbitmq/start.sh b/docker_templates/rabbitmq/start.sh
index 5a3f6c74c..749bee963 120000..100755
--- a/docker_templates/rabbitmq/start.sh
+++ b/docker_templates/rabbitmq/start.sh
@@ -1 +1,23 @@
-../../docker/common/rabbitmq/start.sh \ No newline at end of file
+#!/bin/bash
+
+set -o errexit
+
+CMD="/usr/sbin/rabbitmq-server"
+ARGS=""
+
+# loading common functions
+source /opt/kolla/kolla-common.sh
+
+# Execute config strategy
+set_configs
+
+# loading functions
+source /opt/kolla/config-rabbit.sh
+
+# This catches all cases of the BOOTSTRAP variable being set, including empty
+if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
+ set_rabbitmq_cookie
+ exit 0
+fi
+
+$CMD $ARGS