reload HAProxy config in HA setups when certificate is updated
authorJuan Antonio Osorio Robles <jaosorior@redhat.com>
Mon, 3 Oct 2016 13:56:21 +0000 (16:56 +0300)
committerJuan Antonio Osorio Robles <jaosorior@redhat.com>
Mon, 3 Oct 2016 15:20:29 +0000 (18:20 +0300)
When updating a certificate for HAProxy, we only do a reload of the
configuration on non-HA setups. This means that if we try the same in
an HA setup, the cloud will still serve the old certificate and that
leads to several issues, such as serving a revoked or even a
compromised certificate for some time, or just SSL issues that the
certificate doesn't match. This enables a reload for HA cases too.

Change-Id: Ib8ca2fe91be345ef4324fc8265c45df8108add7a
Closes-Bug: #1629886

puppet/extraconfig/tls/tls-cert-inject.yaml

index e281ef5..49d8457 100644 (file)
@@ -64,11 +64,9 @@ resources:
           | openssl md5 | cut -c 10- \
           > ${heat_outputs_path}.key_modulus
         # We need to reload haproxy in case the certificate changed because
-        # puppet doesn't know the contents of the cert file.  The pacemaker
-        # case is handled separately in a pacemaker-specific resource.
-        pacemaker_status=$(systemctl is-active pacemaker)
+        # puppet doesn't know the contents of the cert file.
         haproxy_status=$(systemctl is-active haproxy)
-        if [ "$pacemaker_status" != "active" -a "$haproxy_status" = "active"]; then
+        if [ "$haproxy_status" = "active" ]; then
             systemctl reload haproxy
         fi