summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
Diffstat (limited to 'manifests')
-rw-r--r--manifests/data.pp20
-rw-r--r--manifests/init.pp19
2 files changed, 37 insertions, 2 deletions
diff --git a/manifests/data.pp b/manifests/data.pp
index aa49285..effa0f8 100644
--- a/manifests/data.pp
+++ b/manifests/data.pp
@@ -24,6 +24,24 @@ class haproxy::data {
'maxconn' => '8000'
}
}
- default: { fail("The $::operatingsystem operating system is not supported with the haproxy module") }
+ 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 $::osfamily 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']],
+ ],
}
}