Return rabbit hosts' ip to client on relation-changed

This commit is contained in:
Adam Gandelman 2011-07-05 14:36:15 -07:00
parent 330402f76f
commit 2af685aaf8
2 changed files with 7 additions and 1 deletions

View File

@ -4,6 +4,9 @@ echo "CHANGED" >>/tmp/log
RABBIT_USER=`relation-get username`
RABBIT_PASSWD=`relation-get password`
DEFAULT_ETH=$(ip route | grep default | awk '{ print $5 }')
IP=$(ifconfig $DEFAULT_ETH | grep 'inet addr' | awk '{ print $2 }' | cut -d: -f2)
RABBIT_CTL='rabbitmqctl'
PASSWD_FILE="/var/run/ensemble/$RABBIT_USER.passwd"
@ -44,3 +47,6 @@ fi
if [[ ! -e $PASSWD_FILE ]] ; then
ensemble-log "WARN: $RABBIT_USER exists, but $PASSWD_FILE does not!"
fi
ensemble-log "Giving peer my IP - $IP"
relation-set ip=$IP

View File

@ -1,6 +1,6 @@
ensemble: formula
name: rabbitmq
revision: 10
revision: 11
summary: "An AMQP server written in Erlang"
description: |
RabbitMQ is an implementation of AMQP, the emerging standard for high