Avoid installing etcd3 in subnodes
We need to handle this better, for now, just don't install
etcd in the sub nodes. We need to setup the proper clustering
mechanism if we want to have etcd3 running in multiple nodes
Change-Id: I8dd385e3c993942473e67d04367cdf74495dbeef
diff --git a/lib/etcd3 b/lib/etcd3
index fa60a39..2a4fa2a 100644
--- a/lib/etcd3
+++ b/lib/etcd3
@@ -36,6 +36,11 @@
# start_etcd3() - Starts to run the etcd process
function start_etcd3 {
+ # Don't install in sub nodes (multinode scenario)
+ if [ "$SERVICE_HOST" != "$HOST_IP" ]; then
+ return
+ fi
+
_install_etcd
local cmd="$ETCD_BIN_DIR/etcd"
@@ -62,10 +67,20 @@
# stop_etcd3() stops the etcd3 process
function stop_etcd3 {
+ # Don't install in sub nodes (multinode scenario)
+ if [ "$SERVICE_HOST" != "$HOST_IP" ]; then
+ return
+ fi
+
$SYSTEMCTL stop $ETCD_SYSTEMD_SERVICE
}
function cleanup_etcd {
+ # Don't install in sub nodes (multinode scenario)
+ if [ "$SERVICE_HOST" != "$HOST_IP" ]; then
+ return
+ fi
+
$SYSTEMCTL disable $ETCD_SYSTEMD_SERVICE
local unitfile="$SYSTEMD_DIR/$ETCD_SYSTEMD_SERVICE"