Merge "Add deployed-server backwards compatible template"
[apex-tripleo-heat-templates.git] / extraconfig / tasks / major_upgrade_controller_pacemaker_1.sh
1 #!/bin/bash
2
3 set -eu
4
5 check_cluster
6 check_pcsd
7 if [[ -n $(is_bootstrap_node) ]]; then
8     check_clean_cluster
9 fi
10 check_python_rpm
11 check_galera_root_password
12 check_disk_for_mysql_dump
13
14 # We want to disable fencing during the cluster --stop as it might fence
15 # nodes where a service fails to stop, which could be fatal during an upgrade
16 # procedure. So we remember the stonith state. If it was enabled we reenable it
17 # at the end of this script
18 if [[ -n $(is_bootstrap_node) ]]; then
19     STONITH_STATE=$(pcs property show stonith-enabled | grep "stonith-enabled" | awk '{ print $2 }')
20     # We create this empty file if stonith was set to true so we can reenable stonith in step2
21     rm -f /var/tmp/stonith-true
22     if [ $STONITH_STATE == "true" ]; then
23         touch /var/tmp/stonith-true
24     fi
25     pcs property set stonith-enabled=false
26 fi
27
28 # Migrate to HA NG and fix up rabbitmq queues
29 # We fix up the rabbitmq ha queues after the migration because it will
30 # restart the rabbitmq resource. Doing it after the migration means no other
31 # services will be restart as there are no other constraints
32 if [[ -n $(is_bootstrap_node) ]]; then
33     migrate_full_to_ng_ha
34     rabbitmq_newton_ocata_upgrade
35 fi
36