Merge "Add flag to assert that puppet manages the keystone endpoints"
[apex-tripleo-heat-templates.git] / extraconfig / tasks / pacemaker_resource_restart.sh
1 #!/bin/bash
2
3 set -eux
4
5 pacemaker_status=$(systemctl is-active pacemaker)
6
7 # Run if pacemaker is running, we're the bootstrap node,
8 # and we're updating the deployment (not creating).
9 if [ "$pacemaker_status" = "active" -a \
10      "$(hiera bootstrap_nodeid)" = "$(facter hostname)" -a \
11      "$(hiera stack_action)" = "UPDATE" ]; then
12
13     PCMK_RESOURCES="haproxy-clone redis-master rabbitmq-clone galera-master openstack-cinder-volume openstack-cinder-backup"
14     # Ten minutes of timeout to restart each resource, given there are no constraints should be enough
15     TIMEOUT=600
16     for resource in $PCMK_RESOURCES; do
17       if pcs status | grep $resource; then
18         pcs resource restart --wait=$TIMEOUT $resource
19       fi
20     done
21 fi