fuel-library/deployment/puppet/haproxy/manifests/service.pp
Stanislaw Bogatkin 1a0f3c0a6d Sync puppet haproxy module from upstream
UP link: https://github.com/puppetlabs/puppetlabs-haproxy
UP commit sha: 4c94112afbb143f54caae0967e29261b41179017
Implements: blueprint ssl-endpoints

Change-Id: Icb96703ad50b111af463cb6c4094091a251ca680
2015-06-18 10:12:07 -05:00

31 lines
772 B
Puppet

# Private class
class haproxy::service inherits haproxy {
if $caller_module_name != $module_name {
fail("Use of private class ${name} by ${caller_module_name}")
}
if $haproxy::_service_manage {
if ($::osfamily == 'Debian') {
file { '/etc/default/haproxy':
content => 'ENABLED=1',
before => Service['haproxy'],
}
}
$_service_enable = $haproxy::_service_ensure ? {
'running' => true,
'stopped' => false,
default => $haproxy::_service_ensure,
}
service { 'haproxy':
ensure => $haproxy::_service_ensure,
enable => $_service_enable,
name => 'haproxy',
hasrestart => true,
hasstatus => true,
restart => $haproxy::restart_command,
}
}
}