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
}
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']
+ }
}
}