Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions plugins/action/common/prepare_plugins/prep_108_vrf_lites.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,16 @@ def prepare(self):
for vrf_lite in model_data["vxlan"]["overlay_extensions"]["vrf_lites"]:
ospf_enabled = True if vrf_lite.get(
"ospf") is not None else False
default_area = vrf_lite.get("ospf", {}).get(
default_ospf_area = vrf_lite.get("ospf", {}).get(
"default_area",
default_values["vxlan"]["overlay_extensions"]["vrf_lites"]["ospf"]["default_area"]
)
ospfv3_enabled = True if vrf_lite.get(
"ospfv3") is not None else False
default_ospfv3_area = vrf_lite.get("ospfv3", {}).get(
"default_area",
default_values["vxlan"]["overlay_extensions"]["vrf_lites"]["ospfv3"]["default_area"]
)
for switch in vrf_lite["switches"]:
unique_name = f"{vrf_lite['name']}_{switch['name']}"

Expand Down Expand Up @@ -151,10 +157,22 @@ def prepare(self):
continue
if intf.get("ospf") is None:
intf["ospf"] = {
"area": default_area
"area": default_ospf_area
}
else:
intf["ospf"]["area"] = default_ospf_area
switch["interfaces"][intf_index] = intf

for intf_index in range(len(switch.get("interfaces", []))):
intf = switch["interfaces"][intf_index]
if not ospfv3_enabled or (intf.get("ospfv3") is not None and intf["ospfv3"].get("area", -1) != -1):
continue
if intf.get("ospfv3") is None:
intf["ospfv3"] = {
"area": default_ospfv3_area
}
else:
intf["ospf"]["area"] = default_area
intf["ospfv3"]["area"] = default_ospfv3_area
switch["interfaces"][intf_index] = intf

# Adding address_family_ipv4_unicast and address_family_ipv6_unicast and child keys
Expand Down
3 changes: 3 additions & 0 deletions roles/dtc/common/templates/ndfc_vrf_lite.j2
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{% if item.ospf is defined and item.ospf %}
{% include 'ndfc_vrf_lite/ndfc_vrf_lite_ospf.j2' %}
{% endif %}
{% if item.ospfv3 is defined and item.ospfv3 %}
{% include 'ndfc_vrf_lite/ndfc_vrf_lite_ospfv3.j2' %}
{% endif %}
{% if (item.bgp is defined and item.bgp) or switch_item.bgp_peers or switch_item.bgp %}
{% include 'ndfc_vrf_lite/ndfc_vrf_lite_ebgp.j2' %}
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@
{% if switch_redist.source == 'static' and switch_redist.route_map_ipv6 %}
redistribute static route-map {{ switch_redist.route_map_ipv6 }}
{% endif %}
{% if switch_redist.source == 'ospf' and switch_redist.route_map_ipv6 %}
redistribute ospf {{ switch_redist.protocol_tag }} route-map {{ switch_redist.route_map_ipv6 }}
{% if switch_redist.source == 'ospfv3' and switch_redist.route_map_ipv6 and switch_redist.protocol_tag %}
redistribute ospfv3 {{ switch_redist.protocol_tag }} route-map {{ switch_redist.route_map_ipv6 }}
{% endif %}
{% endfor %}
{% endif %}
Expand Down
Loading