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..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,11 +74,17 @@ 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_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': []} - 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' 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..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,6 +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) | 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":[] }) %} @@ -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..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,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' %} - 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' %} + 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 }} +{% 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 (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) | 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 %} 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/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 295a4e1e..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 @@ -1,15 +1,14 @@ {# 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) }} 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) | 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) | 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' %} PHANTOM_RP_LB_ID1: {{ vxlan.underlay.multicast.underlay_primary_rp_loopback_id | default(defaults.vxlan.underlay.multicast.underlay_primary_rp_loopback_id) }} @@ -19,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) | 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) | 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 %} {% 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..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,10 +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)}} -{% 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) | 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) }} -{% endif %} 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 %} {% 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..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,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) | 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 diff --git a/roles/validate/files/defaults.yml b/roles/validate/files/defaults.yml index 2f4ffc69..4249fbbf 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::" # 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 @@ -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