This commit is contained in:
Henry Wang 2020-01-30 19:13:51 +08:00
parent 0f6376efbc
commit b28c0773f6

View File

@ -10,7 +10,38 @@ class role::loadbalancer (
Optional[String] $connetc_timeout = '60s', Optional[String] $connetc_timeout = '60s',
) { ) {
class { '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',
},
defaults_options => {
'log' => 'global',
'stats' => 'enable',
'option' => [
'redispatch',
],
'retries' => '3',
'timeout' => [
'http-request 10s',
'queue 1m',
'connect 1m',
'client 1m',
'server 1m',
'check 1m',
],
'maxconn' => '8000',
},
}
include ::haproxy include ::haproxy
haproxy::listen { $rule1 : haproxy::listen { $rule1 :
collect_exported => false, collect_exported => false,
ipaddress => $::ipaddress, ipaddress => $::ipaddress,