loadbalancer: don't manage HAproxy service but allow it to start
Signed-off-by: Emilien Macchi <emilien.macchi@enovance.com>
This commit is contained in:
@@ -231,15 +231,16 @@ class cloud::loadbalancer(
|
||||
}
|
||||
|
||||
# Ensure Keepalived is started before HAproxy to avoid binding errors.
|
||||
# Also, manage HAproxy only where Keepalived is MASTER
|
||||
if $keepalived_state == 'BACKUP' {
|
||||
$manage_haproxy_service = false
|
||||
} else {
|
||||
$manage_haproxy_service = true
|
||||
}
|
||||
class { 'keepalived': } ->
|
||||
class { 'haproxy':
|
||||
service_manage => $manage_haproxy_service
|
||||
service_manage => false
|
||||
}
|
||||
# Still allow HAproxy to start
|
||||
if ($::osfamily == 'Debian') {
|
||||
file { '/etc/default/haproxy':
|
||||
content => 'ENABLED=1',
|
||||
before => Service['haproxy'],
|
||||
}
|
||||
}
|
||||
|
||||
keepalived::vrrp_script { 'haproxy':
|
||||
|
@@ -143,7 +143,7 @@ describe 'cloud::loadbalancer' do
|
||||
})
|
||||
end
|
||||
it 'configure haproxy server with service managed' do
|
||||
should contain_class('haproxy').with(:service_manage => true)
|
||||
should contain_class('haproxy').with(:service_manage => false)
|
||||
end # configure haproxy server
|
||||
end # configure keepalived in master
|
||||
|
||||
|
Reference in New Issue
Block a user