diff options
| author | Steven Dake <stdake@cisco.com> | 2015-08-27 19:01:57 -0700 |
|---|---|---|
| committer | Steven Dake <stdake@cisco.com> | 2015-08-28 00:50:30 -0700 |
| commit | eef32f0353d5cee9b4bb876767aab5c8298375eb (patch) | |
| tree | a4d1660805cc8aa848cf0d5c2949db734317a446 | |
| parent | c685119fec2faa6caab6706aaea25d696493b476 (diff) | |
| download | kolla-eef32f0353d5cee9b4bb876767aab5c8298375eb.tar.gz kolla-eef32f0353d5cee9b4bb876767aab5c8298375eb.zip | |
Move scripts for rabbitmq to docker_templates
Change-Id: I6f06c067c18e4a3eafbed2b2796aa1cfe6c9b28c
Partially-Implements: blueprint remove-docker-dir
| -rw-r--r-- | docker/common/rabbitmq/config-external.sh | 19 | ||||
| -rw-r--r-- | docker/common/rabbitmq/config-rabbit.sh | 7 | ||||
| -rwxr-xr-x | docker/common/rabbitmq/start.sh | 23 | ||||
| -rw-r--r--[l---------] | docker_templates/rabbitmq/config-external.sh | 20 | ||||
| -rw-r--r--[l---------] | docker_templates/rabbitmq/config-rabbit.sh | 8 | ||||
| -rwxr-xr-x[l---------] | docker_templates/rabbitmq/start.sh | 24 |
6 files changed, 49 insertions, 52 deletions
diff --git a/docker/common/rabbitmq/config-external.sh b/docker/common/rabbitmq/config-external.sh deleted file mode 100644 index 33810d621..000000000 --- a/docker/common/rabbitmq/config-external.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/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/common/rabbitmq/config-rabbit.sh b/docker/common/rabbitmq/config-rabbit.sh deleted file mode 100644 index c87a2ab48..000000000 --- a/docker/common/rabbitmq/config-rabbit.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/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/common/rabbitmq/start.sh b/docker/common/rabbitmq/start.sh deleted file mode 100755 index 749bee963..000000000 --- a/docker/common/rabbitmq/start.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/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 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 |
