e3c68b
From bfbda24746bf11573b485baf534a5cf1373c6c89 Mon Sep 17 00:00:00 2001
e3c68b
From: "Kaleb S. KEITHLEY" <kkeithle@redhat.com>
e3c68b
Date: Wed, 7 Jun 2017 08:15:48 -0400
e3c68b
Subject: [PATCH 074/124] common-ha: enable pacemaker at end of setup
e3c68b
e3c68b
Label: DOWNSTREAM ONLY
e3c68b
e3c68b
Change-Id: I3ccd59b67ed364bfc5d27e88321ab5b9f8d471fd
e3c68b
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
e3c68b
Reviewed-on: https://code.engineering.redhat.com/gerrit/108431
e3c68b
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
e3c68b
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
e3c68b
Reviewed-on: https://code.engineering.redhat.com/gerrit/167159
e3c68b
Tested-by: RHGS Build Bot <nigelb@redhat.com>
e3c68b
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
e3c68b
---
e3c68b
 extras/ganesha/scripts/ganesha-ha.sh | 20 ++++++++++++++++++++
e3c68b
 1 file changed, 20 insertions(+)
e3c68b
e3c68b
diff --git a/extras/ganesha/scripts/ganesha-ha.sh b/extras/ganesha/scripts/ganesha-ha.sh
e3c68b
index e1d3ea0..d7dfb87 100644
e3c68b
--- a/extras/ganesha/scripts/ganesha-ha.sh
e3c68b
+++ b/extras/ganesha/scripts/ganesha-ha.sh
e3c68b
@@ -787,6 +787,22 @@ setup_state_volume()
e3c68b
 }
e3c68b
 
e3c68b
 
e3c68b
+enable_pacemaker()
e3c68b
+{
e3c68b
+    while [[ ${1} ]]; do
e3c68b
+        if [ "${SERVICE_MAN}" == "/usr/bin/systemctl" ]; then
e3c68b
+${SECRET_PEM} root@${1} ${SERVICE_MAN} enable pacemaker"
e3c68b
+            ssh -oPasswordAuthentication=no -oStrictHostKeyChecking=no -i \
e3c68b
+${SECRET_PEM} root@${1} "${SERVICE_MAN} enable pacemaker"
e3c68b
+        else
e3c68b
+            ssh -oPasswordAuthentication=no -oStrictHostKeyChecking=no -i \
e3c68b
+${SECRET_PEM} root@${1} "${SERVICE_MAN} pacemaker enable"
e3c68b
+        fi
e3c68b
+        shift
e3c68b
+    done
e3c68b
+}
e3c68b
+
e3c68b
+
e3c68b
 addnode_state_volume()
e3c68b
 {
e3c68b
     local newnode=${1}; shift
e3c68b
@@ -1011,6 +1027,8 @@ main()
e3c68b
 
e3c68b
         if [ "X${HA_NUM_SERVERS}X" != "X1X" ]; then
e3c68b
 
e3c68b
+            determine_service_manager
e3c68b
+
e3c68b
             setup_cluster ${HA_NAME} ${HA_NUM_SERVERS} "${HA_SERVERS}"
e3c68b
 
e3c68b
             setup_create_resources ${HA_SERVERS}
e3c68b
@@ -1019,6 +1037,8 @@ main()
e3c68b
 
e3c68b
             setup_state_volume ${HA_SERVERS}
e3c68b
 
e3c68b
+            enable_pacemaker ${HA_SERVERS}
e3c68b
+
e3c68b
         else
e3c68b
 
e3c68b
             logger "insufficient servers for HA, aborting"
e3c68b
-- 
e3c68b
1.8.3.1
e3c68b