aboutsummaryrefslogtreecommitdiffstats
path: root/extraconfig/tasks
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-04-03 19:58:31 +0000
committerGerrit Code Review <review@openstack.org>2016-04-03 19:58:31 +0000
commit4e862ccee2b4afbb3c8b2265217f408a2d503af7 (patch)
treee8d373cce6c6d9352f38b3b7f49e9ee880b1fa59 /extraconfig/tasks
parent44bad1dd2489d92cd360ffcc4b79d8a5fe94aa2b (diff)
parent4f373ea30feaa678fbc86e0cd92c875f26fdbeac (diff)
Merge "Restart haproxy after configuring SSL certs"
Diffstat (limited to 'extraconfig/tasks')
-rwxr-xr-xextraconfig/tasks/pacemaker_maintenance_mode.sh19
-rw-r--r--extraconfig/tasks/pre_puppet_pacemaker.yaml9
2 files changed, 21 insertions, 7 deletions
diff --git a/extraconfig/tasks/pacemaker_maintenance_mode.sh b/extraconfig/tasks/pacemaker_maintenance_mode.sh
new file mode 100755
index 00000000..ddc84ad2
--- /dev/null
+++ b/extraconfig/tasks/pacemaker_maintenance_mode.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+set -x
+
+# On initial deployment, the pacemaker service is disabled and is-active exits
+# 3 in that case, so allow this to fail gracefully.
+pacemaker_status=$(systemctl is-active pacemaker || :)
+
+if [ "$pacemaker_status" = "active" ]; then
+ pcs property set maintenance-mode=true
+fi
+
+# We need to reload haproxy in case the certificate changed because
+# puppet doesn't know the contents of the cert file. We shouldn't
+# reload it if it wasn't already active (such as if using external
+# loadbalancer or on initial deployment).
+haproxy_status=$(systemctl is-active haproxy || :)
+if [ "$haproxy_status" = "active" ]; then
+ systemctl reload haproxy
+fi
diff --git a/extraconfig/tasks/pre_puppet_pacemaker.yaml b/extraconfig/tasks/pre_puppet_pacemaker.yaml
index 2cfe92a7..82546588 100644
--- a/extraconfig/tasks/pre_puppet_pacemaker.yaml
+++ b/extraconfig/tasks/pre_puppet_pacemaker.yaml
@@ -14,13 +14,8 @@ resources:
type: OS::Heat::SoftwareConfig
properties:
group: script
- config: |
- #!/bin/bash
- pacemaker_status=$(systemctl is-active pacemaker)
-
- if [ "$pacemaker_status" = "active" ]; then
- pcs property set maintenance-mode=true
- fi
+ config:
+ get_file: pacemaker_maintenance_mode.sh
ControllerPrePuppetMaintenanceModeDeployment:
type: OS::Heat::SoftwareDeployments