aboutsummaryrefslogtreecommitdiffstats
path: root/extraconfig/tasks/pacemaker_resource_restart.sh
diff options
context:
space:
mode:
authormarios <marios@redhat.com>2016-05-25 11:56:02 +0300
committerEmilien Macchi <emilien@redhat.com>2016-09-17 04:46:24 +0000
commitfb25385d34e604d2f670cebe3e03fd57c14fa6be (patch)
treeadce59c96cdd5bdf96b9fc644baecadb036254b3 /extraconfig/tasks/pacemaker_resource_restart.sh
parent430db61b817d8e276e3986777fe96a66546c5222 (diff)
Rework the pacemaker_common_functions for M..N upgrades
For N we cannot assume services are managed by pacemaker. This adds functions to check if a service is systemd or pcmk managed and start/stops it accordingly. For pcmk, only stop/disable on bootstrap node for example, whereas systemd should stop/start on all controllers. There is also an equivalent change to the check_resource which has been reworked to allow both pcmk and systemd. Implements: blueprint overcloud-upgrades-workflow-mitaka-to-newton Change-Id: Ic8252736781dc906b3aef8fc756eb8b2f3bb1f02
Diffstat (limited to 'extraconfig/tasks/pacemaker_resource_restart.sh')
-rwxr-xr-xextraconfig/tasks/pacemaker_resource_restart.sh6
1 files changed, 1 insertions, 5 deletions
diff --git a/extraconfig/tasks/pacemaker_resource_restart.sh b/extraconfig/tasks/pacemaker_resource_restart.sh
index fd1fd0dc..3da7efec 100755
--- a/extraconfig/tasks/pacemaker_resource_restart.sh
+++ b/extraconfig/tasks/pacemaker_resource_restart.sh
@@ -2,12 +2,9 @@
set -eux
-pacemaker_status=$(systemctl is-active pacemaker)
-
# Run if pacemaker is running, we're the bootstrap node,
# and we're updating the deployment (not creating).
-if [ "$pacemaker_status" = "active" -a \
- "$(hiera bootstrap_nodeid)" = "$(facter hostname)" ]; then
+if [[ -n $(pcmk_running) && -n $(is_bootstrap_node) ]]; then
TIMEOUT=600
SERVICES_TO_RESTART="$(ls /var/lib/tripleo/pacemaker-restarts)"
@@ -25,5 +22,4 @@ if [ "$pacemaker_status" = "active" -a \
pcs resource restart --wait=$TIMEOUT $service
rm -f /var/lib/tripleo/pacemaker-restarts/$service
done
-
fi