Charm: oneiric/redis-master
Revision: 2
Hook: redis-master-relation-changed
#!/bin/bash
############################################################################################################
# Set debugging information
############################################################################################################
set -ux
############################################################################################################
# Set global variables
############################################################################################################
MY_HOSTNAME=`hostname -f`
MY_PORT="6379"
############################################################################################################
# Set the hostname in the relation so it can be picked up by the _other_ side
############################################################################################################
relation-set hostname="${MY_HOSTNAME}" port="${MY_PORT}"
echo $JUJU_REMOTE_UNIT joined