2020 },
2121 recursive =true ) %}
2222 {{ network.network_name }}_ip: {{ network.ip_v4 }}
23- {% if 'worker-9' == hostname and ' ctlplane' == network .network_name %}
23+ {% if 'ctlplane' == network .network_name %}
2424 base_if: {{ network.interface_name }}
2525{% endif %}
2626{% endfor %}
5050{% endfor %}
5151
5252{% for network in cifmw_networking_env_definition .networks .values () %}
53+ {% if network .network_name != 'ctlplane_ocp_nad' %}
5354{% set ns .lb_tools = {} %}
5455 {{ network.network_name }}:
5556 dnsDomain: {{ network.search_domain }}
9596{% if ns .lb_tools | length > 0 %}
9697 lb_addresses:
9798{% for tool in ns .lb_tools .keys () %}
98- {% for lb_range in network .tools [tool ].ipv 4_ranges %}
99+ {% set lb_range_network = network if network .network_name != "ctlplane" else cifmw_networking_env_definition .networks .ctlplane_ocp_nad %}
100+ {% for lb_range in lb_range_network .tools [tool ].ipv 4_ranges %}
99101 - {{ lb_range.start }}-{{ lb_range.end }}
100102{% set _ = ns .lb_tools [tool ].append (lb_range .start ) %}
101103{% endfor %}
@@ -114,10 +116,10 @@ data:
114116 iface: {{ network.network_name }}
115117 base_iface: {{ ns.interfaces[network.network_name] }}
116118{% endif %}
117- {% else %}
118- {% if ns .interfaces [network .network_name ] is defined %}
119+ {% elif network .network_name == "ctlplane" %}
119120 iface: {{ ns.interfaces[network.network_name] }}
120- {% endif %}
121+ {% elif ns .interfaces [network .network_name ] is defined %}
122+ iface: {{ network.network_name }}
121123{% endif %}
122124{% if network .tools .multus is defined %}
123125 net-attach-def: |
@@ -139,42 +141,36 @@ data:
139141{% endif %}
140142 "ipam": {
141143 "type": "whereabouts",
142- "range": "{{ network.network_v4 }}",
143144{% if network .network_name == "octavia" and network .tools .multus .ipv 4_routes | default ([]) | length > 0 %}
144145 "routes": [
145- {% for route in network .tools .multus .ipv 4_routes %}
146+ {% for route in network .tools .multus .ipv 4_routes %}
146147 {
147148 "dst": "{{ route.destination }}",
148149 "gw": "{{ route.gateway }}"
149150 }{% if not loop .last %} ,{% endif %}
150- {% endfor %}
151+ {% endfor %}
151152 ],
152153{% endif %}
153- "range_start": "{{ network.tools.multus.ipv4_ranges.0.start }}",
154- "range_end": "{{ network.tools.multus.ipv4_ranges.0.end }}",
155- {% if network .network_name == "ctlplane" %}
156- "gateway": "{{ network.network_v4 |ansible.utils.nthhost(2) }}"
157- {% else %}
158- "gateway": "{{ network.network_v4 |ansible.utils.nthhost(1) }}"
159- {% endif %}
154+ {% set range_network = network if network .network_name != "ctlplane" else cifmw_networking_env_definition .networks .ctlplane_ocp_nad %}
155+ "range": "{{ range_network.network_v4 }}",
156+ "range_start": "{{ range_network.tools.multus.ipv4_ranges.0.start }}",
157+ "range_end": "{{ range_network.tools.multus.ipv4_ranges.0.end }}",
158+ "gateway": "{{ range_network.network_v4 |ansible.utils.nthhost(1) }}"
160159 }
161160 }
162161{% endif %}
162+ {% endif %}
163163{% endfor %}
164164
165165 dns-resolver:
166166 config:
167167 server:
168- # We set ctlplane = 192.168.125.0/24 and we rely on this definition to create the nad above.
169- # BGP exposes nad ips by advertising a 192.168.125.X address on the worker, and this would break dns
170- # because the traffic will not be sent to the right nic if a local ip on the same network is present.
171- # To avoid messing with routes etc we hardcode the 122.1 ip here
172- - 192.168.122.1
168+ - "{{ cifmw_networking_env_definition.networks.ctlplane.gw_v4 }}"
173169 search: []
174170 options:
175171 - key: server
176172 values:
177- - 192.168.122.1
173+ - {{ cifmw_networking_env_definition.networks.ctlplane.gw_v4 }}
178174{% for nameserver in cifmw_ci_gen_kustomize_values_nameservers %}
179175 - key: server
180176 values:
0 commit comments