aboutsummaryrefslogtreecommitdiffstats
path: root/manifests/profile/base/haproxy.pp
diff options
context:
space:
mode:
authorJuan Antonio Osorio Robles <jaosorior@redhat.com>2016-08-23 11:37:28 +0300
committerJuan Antonio Osorio Robles <jaosorior@redhat.com>2016-08-29 16:59:18 +0300
commitd30e9bcc067c432fe93519dc5971ea98866a10cb (patch)
treec6b9ed663f614b533ef0f78c9453382e9f943aa5 /manifests/profile/base/haproxy.pp
parentcfe8fb0e00dfbf3fc2b1a3c68d44d8c4e5520b4b (diff)
Reload HAProxy on refresh
If the configuration for the HAProxy class or any of the frontend endpoints has changed, we explicitly execute a reload on HA setups. This is useful since on updates of HA setups we set pacemaker on maintenance mode, and thus we are unable to refresh HAProxy's configuration; The aforementioned detail is problematic, since some puppet configurations rely on HAProxy taking into account the configuration. An example of this is changing a port in the endpoint map or enabling SSL. Change-Id: I7f26257fb43146afebca928f5498ee2174178063
Diffstat (limited to 'manifests/profile/base/haproxy.pp')
-rw-r--r--manifests/profile/base/haproxy.pp14
1 files changed, 14 insertions, 0 deletions
diff --git a/manifests/profile/base/haproxy.pp b/manifests/profile/base/haproxy.pp
index 4f2f850..68ff3e4 100644
--- a/manifests/profile/base/haproxy.pp
+++ b/manifests/profile/base/haproxy.pp
@@ -82,6 +82,20 @@ class tripleo::profile::base::haproxy (
}
include ::tripleo::haproxy
+
+ unless hiera('tripleo::haproxy::haproxy_service_manage', true) {
+ # Reload HAProxy configuration if the haproxy class has refreshed or any
+ # HAProxy frontend endpoint has changed.
+ exec { 'haproxy-reload':
+ command => 'systemctl reload haproxy',
+ path => ['/usr/bin', '/usr/sbin'],
+ refreshonly => true,
+ onlyif => 'pcs property | grep -q "maintenance-mode.*true"',
+ subscribe => Class['::haproxy']
+ }
+ Haproxy::Listen<||> ~> Exec['haproxy-reload']
+ Haproxy::Balancermember<||> ~> Exec['haproxy-reload']
+ }
}
}