summaryrefslogtreecommitdiff
path: root/hooks/replica-set-relation-joined
diff options
Diffstat (limited to 'hooks/replica-set-relation-joined')
l---------[-rwxr-xr-x]hooks/replica-set-relation-joined29
1 files changed, 1 insertions, 28 deletions
diff --git a/hooks/replica-set-relation-joined b/hooks/replica-set-relation-joined
index ecf1e71..f94593a 100755..120000
--- a/hooks/replica-set-relation-joined
+++ b/hooks/replica-set-relation-joined
@@ -1,28 +1 @@
-#!/bin/bash
-# This must be renamed to the name of the relation. The goal here is to
-# affect any change needed by relationships being formed
-# This script should be idempotent.
-
-set -ux
-
-DEFAULT_REPLSET_NAME=`config-get replicaset`
-INSTALL_ORDER=$(echo ${JUJU_UNIT_NAME} | awk -F/ '{ print $2 }')
-HOSTNAME=`unit-get public-address`
-
-############################################################################################################
-# Reconfigure the upstart script to include the replica-set option.
-# We'll need this so, when we add nodes, they can all talk to each other.
-# Replica sets can only talk to each other if they all belong to the same
-# set. In our case, we have defaulted to "myset".
-############################################################################################################
-grep "${DEFAULT_REPLSET_NAME}" /etc/init/mongodb.conf
-if [ $? -ne 0 ];then
- sed -i -e "s/ -- / -- --replSet ${DEFAULT_REPLSET_NAME} /" /etc/init/mongodb.conf
- service mongodb stop
- rm -f /var/lib/mongodb/mongod.lock
- service mongodb start
-fi
-
-relation-set hostname=${HOSTNAME} replset=${DEFAULT_REPLSET_NAME} install-order=${INSTALL_ORDER}
-
-echo $JUJU_REMOTE_UNIT joined
+./hooks.py \ No newline at end of file