Puppet Class: haproxy::service

Inherits:
haproxy
Defined in:
manifests/service.pp

Overview

Private class



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'manifests/service.pp', line 2

class haproxy::service inherits haproxy {
  if $caller_module_name != $module_name {
    fail("Use of private class ${name} by ${caller_module_name}")
  }

  if $_service_manage {
    if ($::osfamily == 'Debian') {
      file { '/etc/default/haproxy':
        content => 'ENABLED=1',
        before  => Service['haproxy'],
      }
    }

    service { 'haproxy':
      ensure     => $_service_ensure,
      enable     => $_service_ensure ? {
        'running' => true,
        'stopped' => false,
        default   => $_service_ensure,
      },
      name       => 'haproxy',
      hasrestart => true,
      hasstatus  => true,
      restart    => $restart_command,
    }
  }
}