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