diff options
author | Cody Herriges <c.a.herriges@gmail.com> | 2012-08-30 09:52:12 -0700 |
---|---|---|
committer | Cody Herriges <c.a.herriges@gmail.com> | 2012-08-30 09:52:12 -0700 |
commit | 83592cd211efbbcd278e6faec350cdaa456fbc62 (patch) | |
tree | 71367a4ce50c542427cf976b64fc4888eadd7b6e /manifests | |
parent | e5e01c43c33ab5f139449477c9997cb2ee21ea74 (diff) | |
parent | 12a8a5d6e0419f26265e325a8cf1e4019dc23895 (diff) |
Merge pull request #3 from hunner/add_debian_support
Add debian support
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/data.pp | 18 | ||||
-rw-r--r-- | manifests/init.pp | 19 |
2 files changed, 36 insertions, 1 deletions
diff --git a/manifests/data.pp b/manifests/data.pp index aa49285..6b27068 100644 --- a/manifests/data.pp +++ b/manifests/data.pp @@ -24,6 +24,24 @@ class haproxy::data { 'maxconn' => '8000' } } + Debian: { + $haproxy_global_options = { 'log' => "${::ipaddress} local0", + 'chroot' => '/var/lib/haproxy', + 'pidfile' => '/var/run/haproxy.pid', + 'maxconn' => '4000', + 'user' => 'haproxy', + 'group' => 'haproxy', + 'daemon' => '', + 'stats' => 'socket /var/lib/haproxy/stats' + } + $haproxy_defaults_options = { 'log' => 'global', + 'stats' => 'enable', + 'option' => 'redispatch', + 'retries' => '3', + 'timeout' => ['http-request 10s', 'queue 1m', 'connect 10s', 'client 1m', 'server 1m', 'check 10s'], + 'maxconn' => '8000' + } + } default: { fail("The $::operatingsystem operating system is not supported with the haproxy module") } } } diff --git a/manifests/init.pp b/manifests/init.pp index 8005aec..f75051c 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -97,6 +97,20 @@ class haproxy ( order => '10', content => template('haproxy/haproxy-base.cfg.erb'), } + + if ($::osfamily == 'Debian') { + file { '/etc/default/haproxy': + content => 'ENABLED=1', + require => Package['haproxy'], + before => Service['haproxy'], + } + } + + file { $haproxy_global_options['chroot']: + ensure => directory, + before => Service['haproxy'], + } + } service { 'haproxy': @@ -111,6 +125,9 @@ class haproxy ( name => 'haproxy', hasrestart => true, hasstatus => true, - require => Concat['/etc/haproxy/haproxy.cfg'], + require => [ + Concat['/etc/haproxy/haproxy.cfg'], + File[$haproxy_global_options['chroot']], + ], } } |