Merge "Increase default RabbitMQ/Erlang TCP timeout from 5 to 15 seconds"
[apex-tripleo-heat-templates.git] / extraconfig / tasks / pacemaker_maintenance_mode.sh
1 #!/bin/bash
2 set -x
3
4 # On initial deployment, the pacemaker service is disabled and is-active exits
5 # 3 in that case, so allow this to fail gracefully.
6 pacemaker_status=$(systemctl is-active pacemaker || :)
7
8 if [ "$pacemaker_status" = "active" ]; then
9     pcs property set maintenance-mode=true
10 fi
11
12 # We need to reload haproxy in case the certificate changed because
13 # puppet doesn't know the contents of the cert file.  We shouldn't
14 # reload it if it wasn't already active (such as if using external
15 # loadbalancer or on initial deployment).
16 haproxy_status=$(systemctl is-active haproxy || :)
17 if [ "$haproxy_status" = "active" ]; then
18     systemctl reload haproxy
19 fi