From fb25385d34e604d2f670cebe3e03fd57c14fa6be Mon Sep 17 00:00:00 2001 From: marios Date: Wed, 25 May 2016 11:56:02 +0300 Subject: 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 --- extraconfig/tasks/pacemaker_resource_restart.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'extraconfig/tasks/pacemaker_resource_restart.sh') 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 -- cgit 1.2.3-korg