From dace66bcd44661286e7b943782a59f6c4b9fa886 Mon Sep 17 00:00:00 2001 From: Matt Tarkington Date: Thu, 19 Dec 2024 19:04:47 -0500 Subject: [PATCH 1/7] fix for 262 --- .../dc_vxlan_fabric/replication/dc_vxlan_fabric_replication.j2 | 2 -- 1 file changed, 2 deletions(-) diff --git a/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/replication/dc_vxlan_fabric_replication.j2 b/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/replication/dc_vxlan_fabric_replication.j2 index 295a4e1e..8f8a38dc 100644 --- a/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/replication/dc_vxlan_fabric_replication.j2 +++ b/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/replication/dc_vxlan_fabric_replication.j2 @@ -1,7 +1,5 @@ {# Auto-generated NDFC DC VXLAN EVPN Replication config data structure for fabric {{ vxlan.global.name }} #} -{% if (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | title) == 'False' %} REPLICATION_MODE: {{ vxlan.underlay.general.replication_mode | default(defaults.vxlan.underlay.general.replication_mode) | title }} -{% endif %} {% if (vxlan.underlay.general.replication_mode | default(defaults.vxlan.underlay.general.replication_mode) | title) == 'Multicast' %} MULTICAST_GROUP_SUBNET: {{ vxlan.underlay.multicast.group_subnet | default(defaults.vxlan.underlay.multicast.group_subnet) }} RP_COUNT: {{ vxlan.underlay.multicast.rendezvous_points | default(defaults.vxlan.underlay.multicast.rendezvous_points) }} From b3832cbc5383d38a1eeeb31629b54ef32591c259 Mon Sep 17 00:00:00 2001 From: Matt Tarkington Date: Thu, 19 Dec 2024 21:33:45 -0500 Subject: [PATCH 2/7] updates to better support ipv6 underlay scenarios --- .../prepare_plugins/prep_001_list_defaults.py | 2 +- .../dc_vxlan_fabric_flow_monitor.j2 | 2 ++ .../general/dc_vxlan_fabric_general.j2 | 10 ++++----- .../dc_vxlan_fabric_replication.j2 | 16 ++++++++++---- .../resources/dc_vxlan_fabric_resources.j2 | 16 +++++++++++--- .../security/dc_vxlan_fabric_security.j2 | 4 +++- roles/validate/files/defaults.yml | 21 +++++++++++++------ 7 files changed, 51 insertions(+), 20 deletions(-) diff --git a/plugins/action/common/prepare_plugins/prep_001_list_defaults.py b/plugins/action/common/prepare_plugins/prep_001_list_defaults.py index 515906c6..f9a5aa2b 100644 --- a/plugins/action/common/prepare_plugins/prep_001_list_defaults.py +++ b/plugins/action/common/prepare_plugins/prep_001_list_defaults.py @@ -74,7 +74,7 @@ def prepare(self): # Check vxlan.topology list elements parent_keys = ['vxlan', 'topology'] dm_check = data_model_key_check(self.model_data, parent_keys) - if 'topology' in dm_check['keys_no_data']: + if ('topology' in dm_check['keys_no_data']) or ('topology' in dm_check['keys_not_found']): self.model_data['vxlan']['topology'] = {'edge_connections': []} self.model_data['vxlan']['topology'] = {'fabric_links': []} self.model_data['vxlan']['topology'] = {'switches': []} diff --git a/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/flow_monitor/dc_vxlan_fabric_flow_monitor.j2 b/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/flow_monitor/dc_vxlan_fabric_flow_monitor.j2 index cc3d2da4..7b22eb5a 100644 --- a/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/flow_monitor/dc_vxlan_fabric_flow_monitor.j2 +++ b/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/flow_monitor/dc_vxlan_fabric_flow_monitor.j2 @@ -1,4 +1,5 @@ {# Auto-generated NDFC DC VXLAN EVPN Flow Monitor config data structure for fabric {{ vxlan.global.name }} #} +{% if not (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | bool ) %} ENABLE_NETFLOW: {{ global.netflow.enable | default(defaults.vxlan.global.netflow.enable) }} {% if global.netflow.enable is defined and global.netflow.enable | bool or defaults.vxlan.global.netflow.enable | bool %} {% if global.netflow.exporter is defined %} @@ -25,4 +26,5 @@ {% endfor %} NETFLOW_MONITOR_LIST: "{{ monitor_dict | tojson | replace('"', '\\"') }}" {% endif %} +{% endif %} {% endif %} \ No newline at end of file diff --git a/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/general/dc_vxlan_fabric_general.j2 b/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/general/dc_vxlan_fabric_general.j2 index a11946d8..35007c51 100644 --- a/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/general/dc_vxlan_fabric_general.j2 +++ b/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/general/dc_vxlan_fabric_general.j2 @@ -1,15 +1,15 @@ {# Auto-generated NDFC DC VXLAN EVPN General config data structure for fabric {{ vxlan.global.name }} #} BGP_AS: {{ global.bgp_asn }} UNDERLAY_IS_V6: {{ (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | title) }} -{% if (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | title) == 'True' %} +{% if (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | bool) %} USE_LINK_LOCAL: {{ vxlan.underlay.ipv6.enable_ipv6_link_local_address | default(defaults.vxlan.underlay.ipv6.enable_ipv6_link_local_address | title) }} -{% if (vxlan.underlay.ipv6.enable_ipv6_link_local_address | default(defaults.vxlan.underlay.ipv6.enable_ipv6_link_local_address) | title) == 'False' %} +{% if not (vxlan.underlay.ipv6.enable_ipv6_link_local_address | default(defaults.vxlan.underlay.ipv6.enable_ipv6_link_local_address) | bool) %} V6_SUBNET_TARGET_MASK: {{ vxlan.underlay.ipv6.underlay_subnet_mask | default(defaults.vxlan.underlay.ipv6.underlay_subnet_mask) }} {% endif %} {% endif %} -{% if (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | title) == 'False' %} - FABRIC_INTERFACE_TYPE: {{ vxlan.underlay.general.fabric_interface_numbering | default(defaults.vxlan.underlay.general.fabric_interface_numbering) }} - SUBNET_TARGET_MASK: {{ vxlan.underlay.general.subnet_mask | default(defaults.vxlan.underlay.general.subnet_mask) }} +{% if not (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | bool) %} + FABRIC_INTERFACE_TYPE: {{ vxlan.underlay.ipv4.fabric_interface_numbering | default(defaults.vxlan.underlay.ipv4.fabric_interface_numbering) }} + SUBNET_TARGET_MASK: {{ vxlan.underlay.ipv4.subnet_mask | default(defaults.vxlan.underlay.ipv4.subnet_mask) }} {% endif %} LINK_STATE_ROUTING: {{ vxlan.underlay.general.routing_protocol | default(defaults.vxlan.underlay.general.routing_protocol) }} RR_COUNT: {{ global.route_reflectors | default(defaults.vxlan.global.route_reflectors) }} diff --git a/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/replication/dc_vxlan_fabric_replication.j2 b/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/replication/dc_vxlan_fabric_replication.j2 index 8f8a38dc..e54893c7 100644 --- a/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/replication/dc_vxlan_fabric_replication.j2 +++ b/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/replication/dc_vxlan_fabric_replication.j2 @@ -1,13 +1,14 @@ {# Auto-generated NDFC DC VXLAN EVPN Replication config data structure for fabric {{ vxlan.global.name }} #} REPLICATION_MODE: {{ vxlan.underlay.general.replication_mode | default(defaults.vxlan.underlay.general.replication_mode) | title }} {% if (vxlan.underlay.general.replication_mode | default(defaults.vxlan.underlay.general.replication_mode) | title) == 'Multicast' %} - MULTICAST_GROUP_SUBNET: {{ vxlan.underlay.multicast.group_subnet | default(defaults.vxlan.underlay.multicast.group_subnet) }} RP_COUNT: {{ vxlan.underlay.multicast.rendezvous_points | default(defaults.vxlan.underlay.multicast.rendezvous_points) }} RP_MODE: {{ vxlan.underlay.multicast.rp_mode | default(defaults.vxlan.underlay.multicast.rp_mode) }} RP_LB_ID: {{ vxlan.underlay.multicast.underlay_rp_loopback_id | default(defaults.vxlan.underlay.multicast.underlay_rp_loopback_id) }} - ENABLE_TRM: {{ (vxlan.underlay.multicast.trm_enable | default(defaults.vxlan.underlay.multicast.trm_enable) | title) }} -{% if (vxlan.underlay.multicast.trm_enable | default(defaults.vxlan.underlay.multicast.trm_enable) | title) == 'True' %} - L3VNI_MCAST_GROUP: {{ vxlan.underlay.multicast.trm_default_group | default(defaults.vxlan.underlay.multicast.trm_default_group) }} +{% if not (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | bool ) %} + MULTICAST_GROUP_SUBNET: {{ vxlan.underlay.multicast.ipv4.group_subnet | default(defaults.vxlan.underlay.multicast.ipv4.group_subnet) }} + ENABLE_TRM: {{ (vxlan.underlay.multicast.ipv4.trm_enable | default(defaults.vxlan.underlay.multicast.ipv4.trm_enable) | title) }} +{% if (vxlan.underlay.multicast.ipv4.trm_enable | default(defaults.vxlan.underlay.multicast.ipv4.trm_enable) | bool) %} + L3VNI_MCAST_GROUP: {{ vxlan.underlay.multicast.ipv4.trm_default_group | default(defaults.vxlan.underlay.multicast.ipv4.trm_default_group) }} {% endif %} {% if vxlan.underlay.multicast.rp_mode | default(defaults.vxlan.underlay.multicast.rp_mode) == 'bidir' %} PHANTOM_RP_LB_ID1: {{ vxlan.underlay.multicast.underlay_primary_rp_loopback_id | default(defaults.vxlan.underlay.multicast.underlay_primary_rp_loopback_id) }} @@ -17,4 +18,11 @@ PHANTOM_RP_LB_ID4: {{ vxlan.underlay.multicast.underlay_third_backup_rp_loopback_id | default(defaults.vxlan.underlay.multicast.underlay_third_backup_rp_loopback_id) }} {% endif %} {% endif %} +{% elif (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | bool ) %} + IPv6_MULTICAST_GROUP_SUBNET: {{ vxlan.underlay.multicast.ipv6.group_subnet | default(defaults.vxlan.underlay.multicast.ipv6.group_subnet) }} + ENABLE_TRMv6: {{ (vxlan.underlay.multicast.ipv6.trm_enable | default(defaults.vxlan.underlay.multicast.ipv6.trm_enable) | title) }} +{% if (vxlan.underlay.multicast.ipv6.trm_enable | default(defaults.vxlan.underlay.multicast.ipv6.trm_enable) | bool) %} + L3VNI_IPv6_MCAST_GROUP: {{ vxlan.underlay.multicast.ipv6.trm_default_group | default(defaults.vxlan.underlay.multicast.ipv6.trm_default_group) }} +{% endif %} +{% endif %} {% endif %} \ No newline at end of file diff --git a/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/resources/dc_vxlan_fabric_resources.j2 b/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/resources/dc_vxlan_fabric_resources.j2 index 1aa0c046..1dc37fd4 100644 --- a/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/resources/dc_vxlan_fabric_resources.j2 +++ b/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/resources/dc_vxlan_fabric_resources.j2 @@ -1,10 +1,20 @@ {# Auto-generated NDFC DC VXLAN EVPN Resources config data structure for fabric {{ vxlan.global.name }} #} - STATIC_UNDERLAY_IP_ALLOC: {{ (vxlan.underlay.general.manual_underlay_allocation | default(defaults.vxlan.underlay.general.manual_underlay_allocation) | title)}} -{% if (vxlan.underlay.general.manual_underlay_allocation | default(defaults.vxlan.underlay.general.manual_underlay_allocation) | title) == 'False' %} -{% if (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | title) == 'False' %} + STATIC_UNDERLAY_IP_ALLOC: {{ (vxlan.underlay.general.manual_underlay_allocation | default(defaults.vxlan.underlay.general.manual_underlay_allocation) | title ) }} +{% if not (vxlan.underlay.general.manual_underlay_allocation | default(defaults.vxlan.underlay.general.manual_underlay_allocation) | bool) %} +{% if not (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | bool ) %} LOOPBACK0_IP_RANGE: {{ vxlan.underlay.ipv4.underlay_routing_loopback_ip_range | default(defaults.vxlan.underlay.ipv4.underlay_routing_loopback_ip_range) }} LOOPBACK1_IP_RANGE: {{ vxlan.underlay.ipv4.underlay_vtep_loopback_ip_range | default(defaults.vxlan.underlay.ipv4.underlay_vtep_loopback_ip_range) }} SUBNET_RANGE: {{ vxlan.underlay.ipv4.underlay_subnet_ip_range | default(defaults.vxlan.underlay.ipv4.underlay_subnet_ip_range) }} +{% elif (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | bool ) %} + LOOPBACK0_IPV6_RANGE: {{ vxlan.underlay.ipv6.underlay_routing_loopback_ip_range | default(defaults.vxlan.underlay.ipv6.underlay_routing_loopback_ip_range) }} + LOOPBACK1_IPV6_RANGE: {{ vxlan.underlay.ipv6.underlay_vtep_loopback_ip_range | default(defaults.vxlan.underlay.ipv6.underlay_vtep_loopback_ip_range) }} +{% if not (vxlan.underlay.ipv6.enable_ipv6_link_local_address | default(defaults.vxlan.underlay.ipv6.enable_ipv6_link_local_address) | bool) %} + V6_SUBNET_RANGE: {{ vxlan.underlay.ipv6.underlay_subnet_ip_range | default(defaults.vxlan.underlay.ipv6.underlay_subnet_ip_range) }} {% endif %} +{% endif %} +{% if not (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | bool ) %} ANYCAST_RP_IP_RANGE: {{ vxlan.underlay.ipv4.underlay_rp_loopback_ip_range | default(defaults.vxlan.underlay.ipv4.underlay_rp_loopback_ip_range) }} +{% elif (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | bool ) %} + IPv6_ANYCAST_RP_IP_RANGE: {{ vxlan.underlay.ipv6.underlay_rp_loopback_ip_range | default(defaults.vxlan.underlay.ipv6.underlay_rp_loopback_ip_range) }} +{% endif %} {% endif %} diff --git a/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/security/dc_vxlan_fabric_security.j2 b/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/security/dc_vxlan_fabric_security.j2 index f23297b1..dc97b285 100644 --- a/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/security/dc_vxlan_fabric_security.j2 +++ b/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/security/dc_vxlan_fabric_security.j2 @@ -1,2 +1,4 @@ {# Auto-generated NDFC DC VXLAN EVPN Security config data structure for fabric {{ vxlan.global.name }} #} - ENABLE_SGT: false \ No newline at end of file +{% if not (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | bool ) %} + ENABLE_SGT: false +{% endif %} \ No newline at end of file diff --git a/roles/validate/files/defaults.yml b/roles/validate/files/defaults.yml index 2f4ffc69..76bd8172 100644 --- a/roles/validate/files/defaults.yml +++ b/roles/validate/files/defaults.yml @@ -113,8 +113,6 @@ factory_defaults: routing_protocol: ospf enable_ipv6_underlay: false replication_mode: multicast - fabric_interface_numbering: p2p - subnet_mask: 30 manual_underlay_allocation: false underlay_routing_loopback_id: 0 underlay_vtep_loopback_id: 1 @@ -124,6 +122,8 @@ factory_defaults: layer2_host_interfacde_mtu: 9216 unshut_host_interfaces: true ipv4: + fabric_interface_numbering: p2p + subnet_mask: 30 underlay_routing_loopback_ip_range: 10.2.0.0/22 underlay_vtep_loopback_ip_range: 10.3.0.0/22 underlay_rp_loopback_ip_range: 10.254.254.0/24 @@ -131,6 +131,10 @@ factory_defaults: ipv6: enable_ipv6_link_local_address: true underlay_subnet_mask: 126 + underlay_routing_loopback_ip_range: fd00::a02:0/119 + underlay_vtep_loopback_ip_range: fd00::a03:0/118 + underlay_rp_loopback_ip_range: fd00::254:254:0/118 + underlay_subnet_ip_range: fd00::a04:0/112 ospf: area_id: 0.0.0.0 authentication_enable: false @@ -146,12 +150,17 @@ factory_defaults: authentication_enable: false authentication_key_type: 3 multicast: - group_subnet: 239.1.1.0/25 rendezvous_points: 2 rp_mode: asm underlay_rp_loopback_id: 254 - trm_enable: false - trm_default_group: 239.1.1.0 + ipv4: + group_subnet: 239.1.1.0/25 + trm_enable: false + trm_default_group: 239.1.1.0 + ipv6: + group_subnet: ff1e::/121 + trm_enable: false + trm_default_group: "ff1e::" underlay_primary_rp_loopback_id: 2 underlay_backup_rp_loopback_id: 3 underlay_second_backup_rp_loopback_id: 4 @@ -280,4 +289,4 @@ factory_defaults: as_override: false route_reflector_client: false default_originate: false - next_hop_self: false \ No newline at end of file + next_hop_self: false From 3f501d6716b19a5479b397f7d89602875333a22a Mon Sep 17 00:00:00 2001 From: Matt Tarkington Date: Fri, 20 Dec 2024 11:34:11 -0500 Subject: [PATCH 3/7] address review comments --- .../common/prepare_plugins/prep_001_list_defaults.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/action/common/prepare_plugins/prep_001_list_defaults.py b/plugins/action/common/prepare_plugins/prep_001_list_defaults.py index f9a5aa2b..b01e82f2 100644 --- a/plugins/action/common/prepare_plugins/prep_001_list_defaults.py +++ b/plugins/action/common/prepare_plugins/prep_001_list_defaults.py @@ -75,10 +75,10 @@ def prepare(self): parent_keys = ['vxlan', 'topology'] dm_check = data_model_key_check(self.model_data, parent_keys) if ('topology' in dm_check['keys_no_data']) or ('topology' in dm_check['keys_not_found']): - self.model_data['vxlan']['topology'] = {'edge_connections': []} - self.model_data['vxlan']['topology'] = {'fabric_links': []} - self.model_data['vxlan']['topology'] = {'switches': []} - self.model_data['vxlan']['topology'] = {'vpc_peers': []} + self.model_data['vxlan']['topology']['edge_connections'] = [] + self.model_data['vxlan']['topology']['fabric_links'] = [] + self.model_data['vxlan']['topology']['switches'] = [] + self.model_data['vxlan']['topology']['vpc_peers'] = [] # Check vxlan.topology.fabric_links list element target_key = 'fabric_links' From 3d0f5ebdcf1f49ef843065296e0ca4716f1ba855 Mon Sep 17 00:00:00 2001 From: Matt Tarkington Date: Sat, 21 Dec 2024 01:47:44 -0500 Subject: [PATCH 4/7] update fqcn name and update prep --- .../common/prepare_plugins/prep_001_list_defaults.py | 8 +++++++- .../flow_monitor/dc_vxlan_fabric_flow_monitor.j2 | 4 ++-- .../general/dc_vxlan_fabric_general.j2 | 6 +++--- .../replication/dc_vxlan_fabric_replication.j2 | 8 ++++---- .../resources/dc_vxlan_fabric_resources.j2 | 12 ++++++------ .../security/dc_vxlan_fabric_security.j2 | 2 +- 6 files changed, 23 insertions(+), 17 deletions(-) diff --git a/plugins/action/common/prepare_plugins/prep_001_list_defaults.py b/plugins/action/common/prepare_plugins/prep_001_list_defaults.py index b01e82f2..6c53e5a6 100644 --- a/plugins/action/common/prepare_plugins/prep_001_list_defaults.py +++ b/plugins/action/common/prepare_plugins/prep_001_list_defaults.py @@ -74,7 +74,13 @@ def prepare(self): # Check vxlan.topology list elements parent_keys = ['vxlan', 'topology'] dm_check = data_model_key_check(self.model_data, parent_keys) - if ('topology' in dm_check['keys_no_data']) or ('topology' in dm_check['keys_not_found']): + if 'topology' in dm_check['keys_not_found']: + self.model_data['vxlan']['topology'] = {} + self.model_data['vxlan']['topology']['edge_connections'] = [] + self.model_data['vxlan']['topology']['fabric_links'] = [] + self.model_data['vxlan']['topology']['switches'] = [] + self.model_data['vxlan']['topology']['vpc_peers'] = [] + if 'topology' in dm_check['keys_no_data']: self.model_data['vxlan']['topology']['edge_connections'] = [] self.model_data['vxlan']['topology']['fabric_links'] = [] self.model_data['vxlan']['topology']['switches'] = [] diff --git a/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/flow_monitor/dc_vxlan_fabric_flow_monitor.j2 b/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/flow_monitor/dc_vxlan_fabric_flow_monitor.j2 index 7b22eb5a..50963a3b 100644 --- a/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/flow_monitor/dc_vxlan_fabric_flow_monitor.j2 +++ b/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/flow_monitor/dc_vxlan_fabric_flow_monitor.j2 @@ -1,7 +1,7 @@ {# Auto-generated NDFC DC VXLAN EVPN Flow Monitor config data structure for fabric {{ vxlan.global.name }} #} -{% if not (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | bool ) %} +{% if not (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | ansible.builtin.bool ) %} ENABLE_NETFLOW: {{ global.netflow.enable | default(defaults.vxlan.global.netflow.enable) }} -{% if global.netflow.enable is defined and global.netflow.enable | bool or defaults.vxlan.global.netflow.enable | bool %} +{% if global.netflow.enable is defined and global.netflow.enable | ansible.builtin.bool or defaults.vxlan.global.netflow.enable | ansible.builtin.bool %} {% if global.netflow.exporter is defined %} {% set exporter_dict = dict() %} {% set _ = exporter_dict.update({ "NETFLOW_EXPORTER_LIST":[] }) %} diff --git a/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/general/dc_vxlan_fabric_general.j2 b/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/general/dc_vxlan_fabric_general.j2 index 35007c51..b0a75a91 100644 --- a/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/general/dc_vxlan_fabric_general.j2 +++ b/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/general/dc_vxlan_fabric_general.j2 @@ -1,13 +1,13 @@ {# Auto-generated NDFC DC VXLAN EVPN General config data structure for fabric {{ vxlan.global.name }} #} BGP_AS: {{ global.bgp_asn }} UNDERLAY_IS_V6: {{ (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | title) }} -{% if (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | bool) %} +{% if (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | ansible.builtin.bool) %} USE_LINK_LOCAL: {{ vxlan.underlay.ipv6.enable_ipv6_link_local_address | default(defaults.vxlan.underlay.ipv6.enable_ipv6_link_local_address | title) }} -{% if not (vxlan.underlay.ipv6.enable_ipv6_link_local_address | default(defaults.vxlan.underlay.ipv6.enable_ipv6_link_local_address) | bool) %} +{% if not (vxlan.underlay.ipv6.enable_ipv6_link_local_address | default(defaults.vxlan.underlay.ipv6.enable_ipv6_link_local_address) | ansible.builtin.bool) %} V6_SUBNET_TARGET_MASK: {{ vxlan.underlay.ipv6.underlay_subnet_mask | default(defaults.vxlan.underlay.ipv6.underlay_subnet_mask) }} {% endif %} {% endif %} -{% if not (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | bool) %} +{% if not (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | ansible.builtin.bool) %} FABRIC_INTERFACE_TYPE: {{ vxlan.underlay.ipv4.fabric_interface_numbering | default(defaults.vxlan.underlay.ipv4.fabric_interface_numbering) }} SUBNET_TARGET_MASK: {{ vxlan.underlay.ipv4.subnet_mask | default(defaults.vxlan.underlay.ipv4.subnet_mask) }} {% endif %} diff --git a/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/replication/dc_vxlan_fabric_replication.j2 b/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/replication/dc_vxlan_fabric_replication.j2 index e54893c7..8067f38b 100644 --- a/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/replication/dc_vxlan_fabric_replication.j2 +++ b/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/replication/dc_vxlan_fabric_replication.j2 @@ -4,10 +4,10 @@ RP_COUNT: {{ vxlan.underlay.multicast.rendezvous_points | default(defaults.vxlan.underlay.multicast.rendezvous_points) }} RP_MODE: {{ vxlan.underlay.multicast.rp_mode | default(defaults.vxlan.underlay.multicast.rp_mode) }} RP_LB_ID: {{ vxlan.underlay.multicast.underlay_rp_loopback_id | default(defaults.vxlan.underlay.multicast.underlay_rp_loopback_id) }} -{% if not (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | bool ) %} +{% if not (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | ansible.builtin.bool ) %} MULTICAST_GROUP_SUBNET: {{ vxlan.underlay.multicast.ipv4.group_subnet | default(defaults.vxlan.underlay.multicast.ipv4.group_subnet) }} ENABLE_TRM: {{ (vxlan.underlay.multicast.ipv4.trm_enable | default(defaults.vxlan.underlay.multicast.ipv4.trm_enable) | title) }} -{% if (vxlan.underlay.multicast.ipv4.trm_enable | default(defaults.vxlan.underlay.multicast.ipv4.trm_enable) | bool) %} +{% if (vxlan.underlay.multicast.ipv4.trm_enable | default(defaults.vxlan.underlay.multicast.ipv4.trm_enable) | ansible.builtin.bool) %} L3VNI_MCAST_GROUP: {{ vxlan.underlay.multicast.ipv4.trm_default_group | default(defaults.vxlan.underlay.multicast.ipv4.trm_default_group) }} {% endif %} {% if vxlan.underlay.multicast.rp_mode | default(defaults.vxlan.underlay.multicast.rp_mode) == 'bidir' %} @@ -18,10 +18,10 @@ PHANTOM_RP_LB_ID4: {{ vxlan.underlay.multicast.underlay_third_backup_rp_loopback_id | default(defaults.vxlan.underlay.multicast.underlay_third_backup_rp_loopback_id) }} {% endif %} {% endif %} -{% elif (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | bool ) %} +{% elif (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | ansible.builtin.bool ) %} IPv6_MULTICAST_GROUP_SUBNET: {{ vxlan.underlay.multicast.ipv6.group_subnet | default(defaults.vxlan.underlay.multicast.ipv6.group_subnet) }} ENABLE_TRMv6: {{ (vxlan.underlay.multicast.ipv6.trm_enable | default(defaults.vxlan.underlay.multicast.ipv6.trm_enable) | title) }} -{% if (vxlan.underlay.multicast.ipv6.trm_enable | default(defaults.vxlan.underlay.multicast.ipv6.trm_enable) | bool) %} +{% if (vxlan.underlay.multicast.ipv6.trm_enable | default(defaults.vxlan.underlay.multicast.ipv6.trm_enable) | ansible.builtin.bool) %} L3VNI_IPv6_MCAST_GROUP: {{ vxlan.underlay.multicast.ipv6.trm_default_group | default(defaults.vxlan.underlay.multicast.ipv6.trm_default_group) }} {% endif %} {% endif %} diff --git a/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/resources/dc_vxlan_fabric_resources.j2 b/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/resources/dc_vxlan_fabric_resources.j2 index 1dc37fd4..0fbcbf8f 100644 --- a/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/resources/dc_vxlan_fabric_resources.j2 +++ b/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/resources/dc_vxlan_fabric_resources.j2 @@ -1,20 +1,20 @@ {# Auto-generated NDFC DC VXLAN EVPN Resources config data structure for fabric {{ vxlan.global.name }} #} STATIC_UNDERLAY_IP_ALLOC: {{ (vxlan.underlay.general.manual_underlay_allocation | default(defaults.vxlan.underlay.general.manual_underlay_allocation) | title ) }} -{% if not (vxlan.underlay.general.manual_underlay_allocation | default(defaults.vxlan.underlay.general.manual_underlay_allocation) | bool) %} -{% if not (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | bool ) %} +{% if not (vxlan.underlay.general.manual_underlay_allocation | default(defaults.vxlan.underlay.general.manual_underlay_allocation) | ansible.builtin.bool) %} +{% if not (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | ansible.builtin.bool ) %} LOOPBACK0_IP_RANGE: {{ vxlan.underlay.ipv4.underlay_routing_loopback_ip_range | default(defaults.vxlan.underlay.ipv4.underlay_routing_loopback_ip_range) }} LOOPBACK1_IP_RANGE: {{ vxlan.underlay.ipv4.underlay_vtep_loopback_ip_range | default(defaults.vxlan.underlay.ipv4.underlay_vtep_loopback_ip_range) }} SUBNET_RANGE: {{ vxlan.underlay.ipv4.underlay_subnet_ip_range | default(defaults.vxlan.underlay.ipv4.underlay_subnet_ip_range) }} -{% elif (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | bool ) %} +{% elif (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | ansible.builtin.bool ) %} LOOPBACK0_IPV6_RANGE: {{ vxlan.underlay.ipv6.underlay_routing_loopback_ip_range | default(defaults.vxlan.underlay.ipv6.underlay_routing_loopback_ip_range) }} LOOPBACK1_IPV6_RANGE: {{ vxlan.underlay.ipv6.underlay_vtep_loopback_ip_range | default(defaults.vxlan.underlay.ipv6.underlay_vtep_loopback_ip_range) }} -{% if not (vxlan.underlay.ipv6.enable_ipv6_link_local_address | default(defaults.vxlan.underlay.ipv6.enable_ipv6_link_local_address) | bool) %} +{% if not (vxlan.underlay.ipv6.enable_ipv6_link_local_address | default(defaults.vxlan.underlay.ipv6.enable_ipv6_link_local_address) | ansible.builtin.bool) %} V6_SUBNET_RANGE: {{ vxlan.underlay.ipv6.underlay_subnet_ip_range | default(defaults.vxlan.underlay.ipv6.underlay_subnet_ip_range) }} {% endif %} {% endif %} -{% if not (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | bool ) %} +{% if not (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | ansible.builtin.bool ) %} ANYCAST_RP_IP_RANGE: {{ vxlan.underlay.ipv4.underlay_rp_loopback_ip_range | default(defaults.vxlan.underlay.ipv4.underlay_rp_loopback_ip_range) }} -{% elif (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | bool ) %} +{% elif (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | ansible.builtin.bool ) %} IPv6_ANYCAST_RP_IP_RANGE: {{ vxlan.underlay.ipv6.underlay_rp_loopback_ip_range | default(defaults.vxlan.underlay.ipv6.underlay_rp_loopback_ip_range) }} {% endif %} {% endif %} diff --git a/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/security/dc_vxlan_fabric_security.j2 b/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/security/dc_vxlan_fabric_security.j2 index dc97b285..52d30c41 100644 --- a/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/security/dc_vxlan_fabric_security.j2 +++ b/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/security/dc_vxlan_fabric_security.j2 @@ -1,4 +1,4 @@ {# Auto-generated NDFC DC VXLAN EVPN Security config data structure for fabric {{ vxlan.global.name }} #} -{% if not (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | bool ) %} +{% if not (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | ansible.builtin.bool ) %} ENABLE_SGT: false {% endif %} \ No newline at end of file From 08a87dac766005a27dd48042f1ecc55eeb64195a Mon Sep 17 00:00:00 2001 From: Matt Tarkington Date: Sat, 21 Dec 2024 08:54:26 -0500 Subject: [PATCH 5/7] fix and clean up templates from testing --- .../flow_monitor/dc_vxlan_fabric_flow_monitor.j2 | 2 +- .../dc_vxlan_fabric/general/dc_vxlan_fabric_general.j2 | 4 ++-- .../protocols/dc_vxlan_fabric_protocols.j2 | 4 ++-- .../replication/dc_vxlan_fabric_replication.j2 | 8 ++++---- .../resources/dc_vxlan_fabric_resources.j2 | 9 +++------ .../dc_vxlan_fabric/security/dc_vxlan_fabric_security.j2 | 2 +- .../dc_vxlan_fabric/vpc/dc_vxlan_fabric_vpc.j2 | 2 +- 7 files changed, 14 insertions(+), 17 deletions(-) diff --git a/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/flow_monitor/dc_vxlan_fabric_flow_monitor.j2 b/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/flow_monitor/dc_vxlan_fabric_flow_monitor.j2 index 50963a3b..3612336b 100644 --- a/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/flow_monitor/dc_vxlan_fabric_flow_monitor.j2 +++ b/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/flow_monitor/dc_vxlan_fabric_flow_monitor.j2 @@ -1,5 +1,5 @@ {# Auto-generated NDFC DC VXLAN EVPN Flow Monitor config data structure for fabric {{ vxlan.global.name }} #} -{% if not (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | ansible.builtin.bool ) %} +{% if not (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | ansible.builtin.bool) %} ENABLE_NETFLOW: {{ global.netflow.enable | default(defaults.vxlan.global.netflow.enable) }} {% if global.netflow.enable is defined and global.netflow.enable | ansible.builtin.bool or defaults.vxlan.global.netflow.enable | ansible.builtin.bool %} {% if global.netflow.exporter is defined %} diff --git a/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/general/dc_vxlan_fabric_general.j2 b/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/general/dc_vxlan_fabric_general.j2 index b0a75a91..8b07d2fb 100644 --- a/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/general/dc_vxlan_fabric_general.j2 +++ b/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/general/dc_vxlan_fabric_general.j2 @@ -1,8 +1,8 @@ {# Auto-generated NDFC DC VXLAN EVPN General config data structure for fabric {{ vxlan.global.name }} #} BGP_AS: {{ global.bgp_asn }} - UNDERLAY_IS_V6: {{ (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | title) }} + UNDERLAY_IS_V6: {{ vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | title }} {% if (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | ansible.builtin.bool) %} - USE_LINK_LOCAL: {{ vxlan.underlay.ipv6.enable_ipv6_link_local_address | default(defaults.vxlan.underlay.ipv6.enable_ipv6_link_local_address | title) }} + USE_LINK_LOCAL: {{ vxlan.underlay.ipv6.enable_ipv6_link_local_address | default(defaults.vxlan.underlay.ipv6.enable_ipv6_link_local_address) | title }} {% if not (vxlan.underlay.ipv6.enable_ipv6_link_local_address | default(defaults.vxlan.underlay.ipv6.enable_ipv6_link_local_address) | ansible.builtin.bool) %} V6_SUBNET_TARGET_MASK: {{ vxlan.underlay.ipv6.underlay_subnet_mask | default(defaults.vxlan.underlay.ipv6.underlay_subnet_mask) }} {% endif %} diff --git a/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/protocols/dc_vxlan_fabric_protocols.j2 b/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/protocols/dc_vxlan_fabric_protocols.j2 index a4f84999..f57d3137 100644 --- a/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/protocols/dc_vxlan_fabric_protocols.j2 +++ b/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/protocols/dc_vxlan_fabric_protocols.j2 @@ -8,7 +8,7 @@ {% if (vxlan.underlay.general.routing_protocol | default(defaults.vxlan.underlay.general.routing_protocol)) == 'ospf' %} OSPF_AREA_ID: {{ vxlan.underlay.ospf.area_id | default(defaults.vxlan.underlay.ospf.area_id) }} {% if (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | title) == 'False' %} - OSPF_AUTH_ENABLE: {{ (vxlan.underlay.ospf.authentication_enable | default(defaults.vxlan.underlay.ospf.authentication_enable) | title) }} + OSPF_AUTH_ENABLE: {{ vxlan.underlay.ospf.authentication_enable | default(defaults.vxlan.underlay.ospf.authentication_enable) | title }} {% endif %} {% if (vxlan.underlay.ospf.authentication_enable | default(defaults.vxlan.underlay.ospf.authentication_enable) | title) == 'True' %} OSPF_AUTH_KEY_ID: {{ vxlan.underlay.ospf.authentication_key_id | default(defaults.vxlan.underlay.ospf.authentication_key_id) }} @@ -19,7 +19,7 @@ {% endif %} {% elif (vxlan.underlay.general.routing_protocol | default(defaults.vxlan.underlay.general.routing_protocol)) == 'is-is' %} ISIS_LEVEL: {{ vxlan.underlay.isis.level | default(defaults.vxlan.underlay.isis.level) }} - ISIS_AUTH_ENABLE: {{ (vxlan.underlay.isis.authentication_enable | default(defaults.vxlan.underlay.isis.authentication_enable) | title) }} + ISIS_AUTH_ENABLE: {{ vxlan.underlay.isis.authentication_enable | default(defaults.vxlan.underlay.isis.authentication_enable) | title }} {% if (vxlan.underlay.isis.authentication_enable | default(defaults.vxlan.underlay.isis.authentication_enable) | title) == 'True' %} ISIS_AUTH_KEYCHAIN_NAME: {{ vxlan.underlay.isis.authentication_keychain_name | default(omit) }} ISIS_AUTH_KEYCHAIN_KEY_ID: {{ vxlan.underlay.isis.authentication_key_id | default(defaults.vxlan.underlay.isis.authentication_key_id) }} diff --git a/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/replication/dc_vxlan_fabric_replication.j2 b/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/replication/dc_vxlan_fabric_replication.j2 index 8067f38b..81df887d 100644 --- a/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/replication/dc_vxlan_fabric_replication.j2 +++ b/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/replication/dc_vxlan_fabric_replication.j2 @@ -4,9 +4,9 @@ RP_COUNT: {{ vxlan.underlay.multicast.rendezvous_points | default(defaults.vxlan.underlay.multicast.rendezvous_points) }} RP_MODE: {{ vxlan.underlay.multicast.rp_mode | default(defaults.vxlan.underlay.multicast.rp_mode) }} RP_LB_ID: {{ vxlan.underlay.multicast.underlay_rp_loopback_id | default(defaults.vxlan.underlay.multicast.underlay_rp_loopback_id) }} -{% if not (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | ansible.builtin.bool ) %} +{% if not (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | ansible.builtin.bool) %} MULTICAST_GROUP_SUBNET: {{ vxlan.underlay.multicast.ipv4.group_subnet | default(defaults.vxlan.underlay.multicast.ipv4.group_subnet) }} - ENABLE_TRM: {{ (vxlan.underlay.multicast.ipv4.trm_enable | default(defaults.vxlan.underlay.multicast.ipv4.trm_enable) | title) }} + ENABLE_TRM: {{ vxlan.underlay.multicast.ipv4.trm_enable | default(defaults.vxlan.underlay.multicast.ipv4.trm_enable) | title }} {% if (vxlan.underlay.multicast.ipv4.trm_enable | default(defaults.vxlan.underlay.multicast.ipv4.trm_enable) | ansible.builtin.bool) %} L3VNI_MCAST_GROUP: {{ vxlan.underlay.multicast.ipv4.trm_default_group | default(defaults.vxlan.underlay.multicast.ipv4.trm_default_group) }} {% endif %} @@ -18,9 +18,9 @@ PHANTOM_RP_LB_ID4: {{ vxlan.underlay.multicast.underlay_third_backup_rp_loopback_id | default(defaults.vxlan.underlay.multicast.underlay_third_backup_rp_loopback_id) }} {% endif %} {% endif %} -{% elif (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | ansible.builtin.bool ) %} +{% elif (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | ansible.builtin.bool) %} IPv6_MULTICAST_GROUP_SUBNET: {{ vxlan.underlay.multicast.ipv6.group_subnet | default(defaults.vxlan.underlay.multicast.ipv6.group_subnet) }} - ENABLE_TRMv6: {{ (vxlan.underlay.multicast.ipv6.trm_enable | default(defaults.vxlan.underlay.multicast.ipv6.trm_enable) | title) }} + ENABLE_TRMv6: {{ vxlan.underlay.multicast.ipv6.trm_enable | default(defaults.vxlan.underlay.multicast.ipv6.trm_enable) | title }} {% if (vxlan.underlay.multicast.ipv6.trm_enable | default(defaults.vxlan.underlay.multicast.ipv6.trm_enable) | ansible.builtin.bool) %} L3VNI_IPv6_MCAST_GROUP: {{ vxlan.underlay.multicast.ipv6.trm_default_group | default(defaults.vxlan.underlay.multicast.ipv6.trm_default_group) }} {% endif %} diff --git a/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/resources/dc_vxlan_fabric_resources.j2 b/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/resources/dc_vxlan_fabric_resources.j2 index 0fbcbf8f..04e25447 100644 --- a/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/resources/dc_vxlan_fabric_resources.j2 +++ b/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/resources/dc_vxlan_fabric_resources.j2 @@ -1,20 +1,17 @@ {# Auto-generated NDFC DC VXLAN EVPN Resources config data structure for fabric {{ vxlan.global.name }} #} - STATIC_UNDERLAY_IP_ALLOC: {{ (vxlan.underlay.general.manual_underlay_allocation | default(defaults.vxlan.underlay.general.manual_underlay_allocation) | title ) }} + STATIC_UNDERLAY_IP_ALLOC: {{ vxlan.underlay.general.manual_underlay_allocation | default(defaults.vxlan.underlay.general.manual_underlay_allocation) | title }} {% if not (vxlan.underlay.general.manual_underlay_allocation | default(defaults.vxlan.underlay.general.manual_underlay_allocation) | ansible.builtin.bool) %} {% if not (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | ansible.builtin.bool ) %} LOOPBACK0_IP_RANGE: {{ vxlan.underlay.ipv4.underlay_routing_loopback_ip_range | default(defaults.vxlan.underlay.ipv4.underlay_routing_loopback_ip_range) }} LOOPBACK1_IP_RANGE: {{ vxlan.underlay.ipv4.underlay_vtep_loopback_ip_range | default(defaults.vxlan.underlay.ipv4.underlay_vtep_loopback_ip_range) }} SUBNET_RANGE: {{ vxlan.underlay.ipv4.underlay_subnet_ip_range | default(defaults.vxlan.underlay.ipv4.underlay_subnet_ip_range) }} + ANYCAST_RP_IP_RANGE: {{ vxlan.underlay.ipv4.underlay_rp_loopback_ip_range | default(defaults.vxlan.underlay.ipv4.underlay_rp_loopback_ip_range) }} {% elif (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | ansible.builtin.bool ) %} LOOPBACK0_IPV6_RANGE: {{ vxlan.underlay.ipv6.underlay_routing_loopback_ip_range | default(defaults.vxlan.underlay.ipv6.underlay_routing_loopback_ip_range) }} LOOPBACK1_IPV6_RANGE: {{ vxlan.underlay.ipv6.underlay_vtep_loopback_ip_range | default(defaults.vxlan.underlay.ipv6.underlay_vtep_loopback_ip_range) }} + IPv6_ANYCAST_RP_IP_RANGE: {{ vxlan.underlay.ipv6.underlay_rp_loopback_ip_range | default(defaults.vxlan.underlay.ipv6.underlay_rp_loopback_ip_range) }} {% if not (vxlan.underlay.ipv6.enable_ipv6_link_local_address | default(defaults.vxlan.underlay.ipv6.enable_ipv6_link_local_address) | ansible.builtin.bool) %} V6_SUBNET_RANGE: {{ vxlan.underlay.ipv6.underlay_subnet_ip_range | default(defaults.vxlan.underlay.ipv6.underlay_subnet_ip_range) }} {% endif %} {% endif %} -{% if not (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | ansible.builtin.bool ) %} - ANYCAST_RP_IP_RANGE: {{ vxlan.underlay.ipv4.underlay_rp_loopback_ip_range | default(defaults.vxlan.underlay.ipv4.underlay_rp_loopback_ip_range) }} -{% elif (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | ansible.builtin.bool ) %} - IPv6_ANYCAST_RP_IP_RANGE: {{ vxlan.underlay.ipv6.underlay_rp_loopback_ip_range | default(defaults.vxlan.underlay.ipv6.underlay_rp_loopback_ip_range) }} -{% endif %} {% endif %} diff --git a/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/security/dc_vxlan_fabric_security.j2 b/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/security/dc_vxlan_fabric_security.j2 index 52d30c41..b7428cc1 100644 --- a/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/security/dc_vxlan_fabric_security.j2 +++ b/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/security/dc_vxlan_fabric_security.j2 @@ -1,4 +1,4 @@ {# Auto-generated NDFC DC VXLAN EVPN Security config data structure for fabric {{ vxlan.global.name }} #} -{% if not (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | ansible.builtin.bool ) %} +{% if not (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | ansible.builtin.bool) %} ENABLE_SGT: false {% endif %} \ No newline at end of file diff --git a/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/vpc/dc_vxlan_fabric_vpc.j2 b/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/vpc/dc_vxlan_fabric_vpc.j2 index 49105ed7..5f09b48e 100644 --- a/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/vpc/dc_vxlan_fabric_vpc.j2 +++ b/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/vpc/dc_vxlan_fabric_vpc.j2 @@ -7,7 +7,7 @@ VPC_PEER_LINK_PO: {{ global.vpc.peer_link_port_channel_id | default(defaults.vxlan.global.vpc.peer_link_port_channel_id) }} VPC_DOMAIN_ID_RANGE: {{ global.vpc.domain_id_range | default(defaults.vxlan.global.vpc.domain_id_range) }} VPC_DELAY_RESTORE: {{ global.vpc.delay_restore_time | default(defaults.vxlan.global.vpc.delay_restore_time) }} - ADVERTISE_PIP_BGP: {{ (global.vpc.advertise_pip | default(defaults.vxlan.global.vpc.advertise_pip) | title) }} + ADVERTISE_PIP_BGP: {{ global.vpc.advertise_pip | default(defaults.vxlan.global.vpc.advertise_pip) | title }} {% if (global.vpc.advertise_pip | default(defaults.vxlan.global.vpc.advertise_pip) | title) == 'False' %} ADVERTISE_PIP_ON_BORDER: {{ global.vpc.advertise_pip_border_only | default(defaults.vxlan.global.vpc.advertise_pip_border_only) | title }} {% endif %} \ No newline at end of file From 57ad4263e146ef6f27a625cf8606da97e38a74b3 Mon Sep 17 00:00:00 2001 From: Matt Tarkington Date: Sat, 21 Dec 2024 14:02:11 -0500 Subject: [PATCH 6/7] fix replication template for ipv6 address ending in colon --- .../dc_vxlan_fabric/replication/dc_vxlan_fabric_replication.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/replication/dc_vxlan_fabric_replication.j2 b/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/replication/dc_vxlan_fabric_replication.j2 index 81df887d..8b8a2627 100644 --- a/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/replication/dc_vxlan_fabric_replication.j2 +++ b/roles/dtc/common/templates/ndfc_fabric/dc_vxlan_fabric/replication/dc_vxlan_fabric_replication.j2 @@ -22,7 +22,7 @@ IPv6_MULTICAST_GROUP_SUBNET: {{ vxlan.underlay.multicast.ipv6.group_subnet | default(defaults.vxlan.underlay.multicast.ipv6.group_subnet) }} ENABLE_TRMv6: {{ vxlan.underlay.multicast.ipv6.trm_enable | default(defaults.vxlan.underlay.multicast.ipv6.trm_enable) | title }} {% if (vxlan.underlay.multicast.ipv6.trm_enable | default(defaults.vxlan.underlay.multicast.ipv6.trm_enable) | ansible.builtin.bool) %} - L3VNI_IPv6_MCAST_GROUP: {{ vxlan.underlay.multicast.ipv6.trm_default_group | default(defaults.vxlan.underlay.multicast.ipv6.trm_default_group) }} + L3VNI_IPv6_MCAST_GROUP: "{{ vxlan.underlay.multicast.ipv6.trm_default_group | default(defaults.vxlan.underlay.multicast.ipv6.trm_default_group) }}" {% endif %} {% endif %} {% endif %} \ No newline at end of file From 2fc196a9cd03c6aa44efd17a086d968bbad1a937 Mon Sep 17 00:00:00 2001 From: Matt Tarkington Date: Sat, 21 Dec 2024 14:04:51 -0500 Subject: [PATCH 7/7] add comment on quote --- roles/validate/files/defaults.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/validate/files/defaults.yml b/roles/validate/files/defaults.yml index 76bd8172..4249fbbf 100644 --- a/roles/validate/files/defaults.yml +++ b/roles/validate/files/defaults.yml @@ -160,7 +160,7 @@ factory_defaults: ipv6: group_subnet: ff1e::/121 trm_enable: false - trm_default_group: "ff1e::" + trm_default_group: "ff1e::" # Quote due to ending in colon to avoid YAML error underlay_primary_rp_loopback_id: 2 underlay_backup_rp_loopback_id: 3 underlay_second_backup_rp_loopback_id: 4