change back

This commit is contained in:
Henry Wang 2019-08-29 11:00:51 +08:00
parent 8ca3c28c95
commit cfa2dc95ea

View File

@ -1,33 +1,41 @@
class role::loadbalancer ( class role::loadbalancer (
Optional[String] $ports1 = '80', Optional[String] $ports1 = '80',
Optional[String] $ports2 = undef, Optional[String] $ports2 = undef,
Optional[String] $rule1 = 'http', Optional[String] $rule1 = 'puppet00',
Optional[String] $rule2 = undef, Optional[String] $rule2 = undef,
# String $backendserver_name1 = '', Optional[String] $backendserver_name1 = '',
# String $backendserver_name2 = '', Optional[String] $backendserver_name2 = '',
# Optional[String] $backendserver_ipaddress1 = undef, Optional[String] $backendserver_ipaddress1 = undef,
# Optional[String] $backendserver_ipaddress2 = undef, Optional[String] $backendserver_ipaddress2 = undef,
) { ) {
include ::haproxy include ::haproxy
haproxy::listen { 'puppet00' : haproxy::listen { $rule1 :
collect_exported => false, collect_exported => false,
ipaddress => $::ipaddress, ipaddress => $::ipaddress,
ports => '8140', ports => '8140',
} }
haproxy::balancermember { 'haproxy' : haproxy::balancermember { 'haproxy01' :
listening_service => 'puppet00', listening_service => $rule1,
server_names => ['compilemaster-01.platform9.puppet.net','compilemaster-02.platform9.puppet.net'], # server_names => ['compilemaster-01.platform9.puppet.net','compilemaster-02.platform9.puppet.net'],
ipaddresses => ['192.168.0.8','192.168.0.10'], # ipaddresses => ['192.168.0.8','192.168.0.10'],
ports => '8140', # ports => '8140',
# options => 'check',
server_names => $backendserver_name1,
ipaddresses => $backendserver_ipaddress1,
ports => $ports1,
options => 'check',
}
haproxy::balancermember { 'haproxy01' :
listening_service => $rule1,
server_names => $backendserver_name2,
ipaddresses => $backendserver_ipaddress2,
ports => $ports1,
options => 'check', options => 'check',
} }
# haproxy::balancermember { $backendserver_name2 :
# listening_service => 'puppetserver',
# server_names => $backendserver_name2,
# ipaddresses => $backendserver_ipaddress2,
# ports => $ports1,
# options => 'check',
# }
} }