Browse Source

Use /32 or /128 netmask for VIPs

Commit 1ebf115f85 hard code
the netmask for VIPs to /32. This will not work for IPv6.

Add a conditional checking for ':' in the IP addresses for
control_virtual_ip and public_virtual_ip and set netmask
correctly based on IP version.

Related-Bug: #1878101
Change-Id: I00718cf436ba438ef19c1a42aa2d2004fe73dcd2
(cherry picked from commit 2f38880744)
changes/46/731046/1
Harald Jensås 1 year ago
committed by Emilien Macchi
parent
commit
4dba85d815
  1. 6
      net-config-standalone.j2.yaml
  2. 6
      net-config-undercloud.j2.yaml

6
net-config-standalone.j2.yaml

@ -92,6 +92,8 @@ conditions:
equals: [{get_param: StandaloneNetConfigOverride}, {}]
control_virtual_ip_unset: {equals : [{get_param: [DeployedServerPortMap, 'control_virtual_ip', fixed_ips, 0, ip_address]}, '']}
public_virtual_ip_unset: {equals : [{get_param: [DeployedServerPortMap, 'public_virtual_ip', fixed_ips, 0, ip_address]}, '']}
control_virtual_ip_is_ipv6: {contains: [':', {get_param: [DeployedServerPortMap, 'control_virtual_ip', fixed_ips, 0, ip_address]}]}
public_virtual_ip_is_ipv6: {contains: [':', {get_param: [DeployedServerPortMap, 'public_virtual_ip', fixed_ips, 0, ip_address]}]}
resources:
OsNetConfigImpl:
@ -135,7 +137,7 @@ resources:
list_join:
- /
- - {get_param: [DeployedServerPortMap, 'control_virtual_ip', fixed_ips, 0, ip_address]}
- '32'
- {if: [control_virtual_ip_is_ipv6, '128', '32']}
-
if:
- public_virtual_ip_unset
@ -144,7 +146,7 @@ resources:
list_join:
- /
- - {get_param: [DeployedServerPortMap, 'public_virtual_ip', fixed_ips, 0, ip_address]}
- '32'
- {if: [public_virtual_ip_is_ipv6, '128', '32']}
routes: {get_param: ControlPlaneStaticRoutes}
members:
- type: interface

6
net-config-undercloud.j2.yaml

@ -88,6 +88,8 @@ conditions:
equals: [{get_param: UndercloudNetConfigOverride}, {}]
control_virtual_ip_unset: {equals : [{get_param: [DeployedServerPortMap, 'control_virtual_ip', fixed_ips, 0, ip_address]}, '']}
public_virtual_ip_unset: {equals : [{get_param: [DeployedServerPortMap, 'public_virtual_ip', fixed_ips, 0, ip_address]}, '']}
control_virtual_ip_is_ipv6: {contains: [':', {get_param: [DeployedServerPortMap, 'control_virtual_ip', fixed_ips, 0, ip_address]}]}
public_virtual_ip_is_ipv6: {contains: [':', {get_param: [DeployedServerPortMap, 'public_virtual_ip', fixed_ips, 0, ip_address]}]}
resources:
OsNetConfigImpl:
@ -130,7 +132,7 @@ resources:
list_join:
- /
- - {get_param: [DeployedServerPortMap, 'control_virtual_ip', fixed_ips, 0, ip_address]}
- '32'
- {if: [control_virtual_ip_is_ipv6, '128', '32']}
-
if:
- public_virtual_ip_unset
@ -139,7 +141,7 @@ resources:
list_join:
- /
- - {get_param: [DeployedServerPortMap, 'public_virtual_ip', fixed_ips, 0, ip_address]}
- '32'
- {if: [public_virtual_ip_is_ipv6, '128', '32']}
routes: {get_param: ControlPlaneStaticRoutes}
members:
- type: interface

Loading…
Cancel
Save