diff --git a/roles/dtc/common/templates/ndfc_vrf_lite/ndfc_vrf_lite_ebgp.j2 b/roles/dtc/common/templates/ndfc_vrf_lite/ndfc_vrf_lite_ebgp.j2 index 2f312dc8..c9df6568 100644 --- a/roles/dtc/common/templates/ndfc_vrf_lite/ndfc_vrf_lite_ebgp.j2 +++ b/roles/dtc/common/templates/ndfc_vrf_lite/ndfc_vrf_lite_ebgp.j2 @@ -49,7 +49,7 @@ {% if switch_redist.source == 'static' and switch_redist.route_map_ipv4 %} redistribute static route-map {{ switch_redist.route_map_ipv4 }} {% endif %} - {% if switch_redist.source == 'ospf' and switch_redist.route_map_ipv4 %} + {% if switch_redist.source == 'ospf' and switch_redist.route_map_ipv4 and switch_redist.protocol_tag %} redistribute ospf {{ switch_redist.protocol_tag }} route-map {{ switch_redist.route_map_ipv4 }} {% endif %} {% endfor %} @@ -200,6 +200,5 @@ router bgp {{ data_model_extended.vxlan.global[simplified_fabric_type].bgp_asn } router bgp {{ data_model_extended.vxlan.global[simplified_fabric_type].bgp_asn }} {# Other VRFs #} vrf {{ item.vrf }} - {{- vrf_lite_ebgp_vrf_config(item, switch_item, defaults) | indent(2) -}} {% endif %} diff --git a/roles/dtc/common/templates/ndfc_vrf_lite/ndfc_vrf_lite_ospf.j2 b/roles/dtc/common/templates/ndfc_vrf_lite/ndfc_vrf_lite_ospf.j2 index 709dca3d..72cdc9ae 100644 --- a/roles/dtc/common/templates/ndfc_vrf_lite/ndfc_vrf_lite_ospf.j2 +++ b/roles/dtc/common/templates/ndfc_vrf_lite/ndfc_vrf_lite_ospf.j2 @@ -31,24 +31,24 @@ area {{ area.id | ipaddr('address') }} nssa {%- set nssa_options_flags_enabled = true -%} {% endif %} {% if nssa_options.no_redistribution is true %} - {% set _= nssa_options_flags.append("no-redistribution") -%} + {%- set _= nssa_options_flags.append("no-redistribution") -%} {%- set nssa_options_flags_enabled = true -%} {% endif %} {% if nssa_options.default_information_originate is true %} - {% set _= nssa_options_flags.append("default-information-originate") %} + {%- set _= nssa_options_flags.append("default-information-originate") -%} {% if area.nssa.route_map %} - {% set _= nssa_options_flags.append("route-map") %} - {% set _= nssa_options_flags.append(area.nssa.route_map) %} - {% set nssa_options_flags_enabled = true %} + {%- set _= nssa_options_flags.append("route-map") -%} + {%- set _= nssa_options_flags.append(area.nssa.route_map) -%} + {%- set nssa_options_flags_enabled = true -%} {% endif %} {% endif %} {% if nssa_options.translate_always is true %} - {% set _= nssa_options_translate.append("always") %} - {% set nssa_options_translate_enabled = true %} + {%- set _= nssa_options_translate.append("always") -%} + {%- set nssa_options_translate_enabled = true -%} {% endif %} {% if nssa_options.translate_supress_fa is true %} - {% set _= nssa_options_translate.append("supress-fa") %} - {% set nssa_options_translate_enabled = true %} + {%- set _= nssa_options_translate.append("supress-fa") -%} + {%- set nssa_options_translate_enabled = true -%} {% endif %} {% if nssa_options.translate_never is true %} {% set _= nssa_options_translate.append("never") %} @@ -85,7 +85,6 @@ default-information originate {% endif %} {% endif %} {% endmacro %} - feature ospf {% set redistribute = {} %} {% set feature = {} %} @@ -112,7 +111,7 @@ router ospf {{ item.ospf['process'] }} {% endif %} {% if item.ospf.areas is defined and item.ospf.areas %} {% for area in item.ospf.areas %} - {{- render_ospf_area(area, defaults) -}} + {{ render_ospf_area(area, defaults) | trim | indent(2) }} {% endfor %} {% endif %} {% if (item.ospf.distance and item.ospf.distance != 110) or (item.ospf.distance is not defined and defaults.vxlan.overlay_extensions.vrf_lites.ospf.distance != 110) %} @@ -142,9 +141,9 @@ router ospf {{ item.ospf['process'] }} router-id {{ switch_item['router_id'] }} {% endif %} {% if item.ospf.areas %} - {% for area in item.ospf.areas %} - {{- render_ospf_area(area, defaults) -}} - {% endfor %} + {% for area in item.ospf.areas %} + {{ render_ospf_area(area, defaults) | trim | indent(4) }} + {% endfor %} {% endif %} {% if (item.ospf.distance and item.ospf.distance != 110) or (item.ospf.distance is not defined and defaults.vxlan.overlay_extensions.vrf_lites.ospf.distance != 110) %} distance {{ item.ospf.distance }} diff --git a/roles/validate/files/rules/ibgp_vxlan/502_policy_vrf_lite_cross_reference.py b/roles/validate/files/rules/ibgp_vxlan/502_policy_vrf_lite_cross_reference.py index e06dc1c4..c41acfeb 100644 --- a/roles/validate/files/rules/ibgp_vxlan/502_policy_vrf_lite_cross_reference.py +++ b/roles/validate/files/rules/ibgp_vxlan/502_policy_vrf_lite_cross_reference.py @@ -114,7 +114,7 @@ def check_global_ospf_area(cls, policy): """ Check OSPF if backbone area is standard """ - if policy.get("ospf") and not policy["ospf"].get("areas"): + if policy.get("ospf") and policy["ospf"].get("areas"): for area in policy["ospf"]["areas"]: if "id" in area and area.get("area_type"): # Check if AREA 0 is not standard