Add LoadBalancer Profile
This commit is contained in:
parent
0980b482a4
commit
507d8798d8
34
site-modules/role/manifests/loadbalancer.pp
Normal file
34
site-modules/role/manifests/loadbalancer.pp
Normal file
@ -0,0 +1,34 @@
|
||||
class role::loadbalancer (
|
||||
Integer $ports1 = '80',
|
||||
Integer $ports2 = undef,
|
||||
String $rule1 = 'Http',
|
||||
String $rule2 = undef,
|
||||
String $backendserver_name1 = '',
|
||||
String $backendserver_name2 = '',
|
||||
Integer $backendserver_ipaddress1 = undef,
|
||||
Integer $backendserver_ipaddress2 = undef,
|
||||
) {
|
||||
include ::haproxy
|
||||
haproxy::listen { $rule1 :
|
||||
collect_exported => false,
|
||||
ipaddress => $::ipaddress,
|
||||
ports => $ports1,
|
||||
}
|
||||
|
||||
haproxy::balancermember { $backendserver_name1 :
|
||||
listening_service => 'puppetserver',
|
||||
server_names => $backendserver_name1,
|
||||
ipaddress => $backendserver_ipaddress1
|
||||
ports => $ports1,
|
||||
options => 'check',
|
||||
}
|
||||
|
||||
haproxy::balancermember { $backendserver_name2 :
|
||||
listening_service => 'puppetserver',
|
||||
server_names => $backendserver_name2,
|
||||
ipaddress => $backendserver_ipaddress2
|
||||
ports => $ports1,
|
||||
options => 'check',
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user