Merge "Restart haproxy after configuring SSL certs"
[apex-tripleo-heat-templates.git] / extraconfig / tasks / major_upgrade_pacemaker_migrations.sh
1 #!/bin/bash
2
3 # Special pieces of upgrade migration logic go into this
4 # file. E.g. Pacemaker cluster transitions for existing deployments,
5 # matching changes to overcloud_controller_pacemaker.pp (Puppet
6 # handles deployment, this file handles migrations).
7 #
8 # This file shouldn't execute any action on its own, all logic should
9 # be wrapped into bash functions. Upgrade scripts will source this
10 # file and call the functions defined in this file where appropriate.
11 #
12 # The migration functions should be idempotent. If the migration has
13 # been already applied, it should be possible to call the function
14 # again without damaging the deployment or failing the upgrade.
15
16 function remove_ceilometer_alarm {
17     if pcs status | grep openstack-ceilometer-alarm; then
18         # Disable pacemaker resources for ceilometer-alarms
19         pcs resource disable openstack-ceilometer-alarm-evaluator
20         check_resource openstack-ceilometer-alarm-evaluator stopped 600
21         pcs resource delete openstack-ceilometer-alarm-evaluator
22         pcs resource disable openstack-ceilometer-alarm-notifier
23         check_resource openstack-ceilometer-alarm-notifier stopped 600
24         pcs resource delete openstack-ceilometer-alarm-notifier
25
26         # remove constraints
27         pcs constraint remove ceilometer-delay-then-ceilometer-alarm-evaluator-constraint
28         pcs constraint remove ceilometer-alarm-evaluator-with-ceilometer-delay-colocation
29         pcs constraint remove ceilometer-alarm-evaluator-then-ceilometer-alarm-notifier-constraint
30         pcs constraint remove ceilometer-alarm-notifier-with-ceilometer-alarm-evaluator-colocation
31         pcs constraint remove ceilometer-alarm-notifier-then-ceilometer-notification-constraint
32         pcs constraint remove ceilometer-notification-with-ceilometer-alarm-notifier-colocation
33
34     fi
35
36     # uninstall openstack-ceilometer-alarm package
37     yum -y remove openstack-ceilometer-alarm
38
39 }