Merge "Fix nic selection when no nic is specified"

This commit is contained in:
Zuul 2020-12-11 23:13:30 +00:00 committed by Gerrit Code Review
commit 21b6e16af8
2 changed files with 16 additions and 6 deletions

View File

@ -75,18 +75,20 @@ define tripleo::pacemaker::haproxy_with_vip(
if !is_ip_addresses($ip_address) {
fail("Haproxy VIP: ${ip_address} is not a proper IP address.")
}
if $nic != undef {
$nic_real = $nic
} else {
$nic_real = ''
}
if is_ipv6_address($ip_address) {
$netmask = '128'
$vip_nic = interface_for_ip($ip_address)
$ipv6_addrlabel = '99'
} else {
$netmask = '32'
$vip_nic = ''
$ipv6_addrlabel = ''
}
if $nic != undef {
$nic_real = $nic
} else {
$nic_real = $vip_nic
}
$haproxy_in_container = hiera('haproxy_docker', false)
$constraint_target_name = $haproxy_in_container ? {

View File

@ -324,16 +324,24 @@ monitor interval=30s role=Slave timeout=${dbs_timeout}s",
if $ovn_separate_vip {
if is_ipv6_address($ovn_dbs_vip) {
$netmask = '128'
$vip_nic = interface_for_ip($ovn_dbs_vip)
$ipv6_addrlabel = '99'
} else {
$netmask = '32'
$vip_nic = ''
$ipv6_addrlabel = ''
}
if $ovn_dbs_vip_nic != undef {
$nic_real = $ovn_dbs_vip_nic
} else {
$nic_real = $vip_nic
}
pacemaker::resource::ip { "${ovndb_vip_resource_name}":
ip_address => $ovn_dbs_vip,
cidr_netmask => $netmask,
nic => $ovn_dbs_vip_nic,
nic => $nic_real,
ipv6_addrlabel => $ipv6_addrlabel,
location_rule => $ovn_dbs_location_rule,
meta_params => "resource-stickiness=INFINITY ${meta_params}",