1a0f3c0a6d
UP link: https://github.com/puppetlabs/puppetlabs-haproxy UP commit sha: 4c94112afbb143f54caae0967e29261b41179017 Implements: blueprint ssl-endpoints Change-Id: Icb96703ad50b111af463cb6c4094091a251ca680
31 lines
772 B
Puppet
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,
|
|
}
|
|
}
|
|
}
|