forked from puppetlabs/puppetlabs-peadm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathload_balancer.pp
66 lines (61 loc) · 1.59 KB
/
load_balancer.pp
1
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# @summary Example class for PE compiler load balancer
#
# This is a sample, not functional, demonstrating approximately what it would
# take to configure HA Proxy as a load balancer for Puppet Enterprise.
#
# lint:ignore:autoloader_layout
class load_balancer {
class { 'haproxy':
global_options => {
'log' => "${::ipaddress} local2",
'chroot' => '/var/lib/haproxy',
'pidfile' => '/var/run/haproxy.pid',
'maxconn' => 5000,
'user' => 'haproxy',
'group' => 'haproxy',
'daemon' => '',
'stats' => 'socket /var/lib/haproxy/stats',
},
defaults_options => {
'timeout' => [
'connect 10s',
'queue 1m',
'client 2m',
'server 2m',
'http-request 120s',
]
}
}
haproxy::listen { 'puppetserver':
collect_exported => true,
mode => 'tcp',
ipaddress => $::ipaddress,
ports => '8140',
options => {
option => ['tcplog'],
balance => 'leastconn',
},
}
haproxy::listen { 'pcp-broker':
collect_exported => true,
mode => 'tcp',
ipaddress => $::ipaddress,
ports => '8142',
options => {
option => ['tcplog'],
balance => 'leastconn',
timeout => [
'tunnel 15m',
'client-fin 30s',
],
},
}
# TODO: split load balancing into two pools, A and B
haproxy::listen { 'puppetdb':
collect_exported => true,
ipaddress => $::ipaddress,
ports => '8081',
options => {},
}
}
# lint:endignore