Return rabbit hosts' ip to client on relation-changed
This commit is contained in:
parent
330402f76f
commit
2af685aaf8
|
@ -4,6 +4,9 @@ echo "CHANGED" >>/tmp/log
|
||||||
RABBIT_USER=`relation-get username`
|
RABBIT_USER=`relation-get username`
|
||||||
RABBIT_PASSWD=`relation-get password`
|
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'
|
RABBIT_CTL='rabbitmqctl'
|
||||||
PASSWD_FILE="/var/run/ensemble/$RABBIT_USER.passwd"
|
PASSWD_FILE="/var/run/ensemble/$RABBIT_USER.passwd"
|
||||||
|
|
||||||
|
@ -44,3 +47,6 @@ fi
|
||||||
if [[ ! -e $PASSWD_FILE ]] ; then
|
if [[ ! -e $PASSWD_FILE ]] ; then
|
||||||
ensemble-log "WARN: $RABBIT_USER exists, but $PASSWD_FILE does not!"
|
ensemble-log "WARN: $RABBIT_USER exists, but $PASSWD_FILE does not!"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
ensemble-log "Giving peer my IP - $IP"
|
||||||
|
relation-set ip=$IP
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
ensemble: formula
|
ensemble: formula
|
||||||
name: rabbitmq
|
name: rabbitmq
|
||||||
revision: 10
|
revision: 11
|
||||||
summary: "An AMQP server written in Erlang"
|
summary: "An AMQP server written in Erlang"
|
||||||
description: |
|
description: |
|
||||||
RabbitMQ is an implementation of AMQP, the emerging standard for high
|
RabbitMQ is an implementation of AMQP, the emerging standard for high
|
||||||
|
|
Loading…
Reference in New Issue