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:
Emilien Macchi
2014-05-05 13:56:13 +02:00
parent de3fae9b19
commit d604583232
2 changed files with 9 additions and 8 deletions

View File

@@ -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':

View File

@@ -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