From 889547ff5ed22205287245a8416d6bda43cd2d9c Mon Sep 17 00:00:00 2001 From: Alexander Trost Date: Wed, 19 Apr 2017 07:48:40 +0200 Subject: [PATCH] configure-rabbitmq: Add support for RABBITMQ_NODE flag. This can potentially be used by things like a Docker configuration that runs RabbitMQ on another server. --- scripts/setup/configure-rabbitmq | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/scripts/setup/configure-rabbitmq b/scripts/setup/configure-rabbitmq index 46715cf521..ff40e59c28 100755 --- a/scripts/setup/configure-rabbitmq +++ b/scripts/setup/configure-rabbitmq @@ -5,11 +5,14 @@ set -e set -x +if [ -n "$RABBITMQ_NODE" ]; then + RABBITMQ_FLAGS="-n $RABBITMQ_NODE" +fi RABBITMQ_USERNAME=$("$(dirname "$0")/../get-django-setting" RABBITMQ_USERNAME) RABBITMQ_PASSWORD=$("$(dirname "$0")/../get-django-setting" RABBITMQ_PASSWORD) -sudo rabbitmqctl delete_user "$RABBITMQ_USERNAME" || true -sudo rabbitmqctl delete_user zulip || true -sudo rabbitmqctl delete_user guest || true -sudo rabbitmqctl add_user "$RABBITMQ_USERNAME" "$RABBITMQ_PASSWORD" -sudo rabbitmqctl set_user_tags "$RABBITMQ_USERNAME" administrator -sudo rabbitmqctl set_permissions -p / "$RABBITMQ_USERNAME" '.*' '.*' '.*' +sudo rabbitmqctl $RABBITMQ_FLAGS delete_user "$RABBITMQ_USERNAME" || true +sudo rabbitmqctl $RABBITMQ_FLAGS delete_user zulip || true +sudo rabbitmqctl $RABBITMQ_FLAGS delete_user guest || true +sudo rabbitmqctl $RABBITMQ_FLAGS add_user "$RABBITMQ_USERNAME" "$RABBITMQ_PASSWORD" +sudo rabbitmqctl $RABBITMQ_FLAGS set_user_tags "$RABBITMQ_USERNAME" administrator +sudo rabbitmqctl $RABBITMQ_FLAGS set_permissions -p / "$RABBITMQ_USERNAME" '.*' '.*' '.*'