Merge "loadbalancer: allow to change HAproxy monitor VIP"
This commit is contained in:
commit
5f6b9e88d7
@ -184,6 +184,10 @@
|
||||
# Should be part of keepalived_internal_ips
|
||||
# Defaults to false (backward compatibility)
|
||||
#
|
||||
# [*vip_monitor_ip*]
|
||||
# (optional) Array or string for monitor VIP
|
||||
# Defaults to false
|
||||
#
|
||||
# [*firewall_settings*]
|
||||
# (optional) Allow to add custom parameters to firewall rules
|
||||
# Should be an hash.
|
||||
@ -260,6 +264,7 @@ class cloud::loadbalancer(
|
||||
$spice_port = 6082,
|
||||
$vip_public_ip = ['127.0.0.1'],
|
||||
$vip_internal_ip = false,
|
||||
$vip_monitor_ip = false,
|
||||
$galera_ip = ['127.0.0.1'],
|
||||
$galera_slave = false,
|
||||
$firewall_settings = {},
|
||||
@ -357,8 +362,14 @@ class cloud::loadbalancer(
|
||||
mode => '0644';
|
||||
}
|
||||
|
||||
if $vip_monitor_ip {
|
||||
$vip_monitor_ip_real = $vip_monitor_ip
|
||||
} else {
|
||||
$vip_monitor_ip_real = $vip_public_ip
|
||||
}
|
||||
|
||||
haproxy::listen { 'monitor':
|
||||
ipaddress => $vip_public_ip,
|
||||
ipaddress => $vip_monitor_ip_real,
|
||||
ports => '9300',
|
||||
options => {
|
||||
'mode' => 'http',
|
||||
|
@ -236,6 +236,16 @@ describe 'cloud::loadbalancer' do
|
||||
)}
|
||||
end # configure monitor haproxy listen
|
||||
|
||||
context 'configure monitor haproxy listen with another vip' do
|
||||
before do
|
||||
params.merge!( :vip_monitor_ip => ['192.168.0.1'] )
|
||||
end
|
||||
it { is_expected.to contain_haproxy__listen('monitor').with(
|
||||
:ipaddress => ['192.168.0.1'],
|
||||
:ports => '9300'
|
||||
)}
|
||||
end # configure monitor haproxy listen
|
||||
|
||||
context 'configure galera haproxy listen' do
|
||||
it { is_expected.to contain_haproxy__listen('galera_cluster').with(
|
||||
:ipaddress => params[:galera_ip],
|
||||
|
Loading…
x
Reference in New Issue
Block a user