diff --git a/ansible_collections/arista/avd/extensions/molecule/eos_designs_negative_unit_tests/converge.yml b/ansible_collections/arista/avd/extensions/molecule/eos_designs_negative_unit_tests/converge.yml index 6bd8f8a80b4..4207609fed6 100644 --- a/ansible_collections/arista/avd/extensions/molecule/eos_designs_negative_unit_tests/converge.yml +++ b/ansible_collections/arista/avd/extensions/molecule/eos_designs_negative_unit_tests/converge.yml @@ -629,6 +629,22 @@ - ansible_failed_result is defined - ansible_failed_result.msg == expected_error_message +- name: Converge Negative tests for 'eos_designs_facts' + hosts: FABRIC_UNDERLAY_ROUTER_WITH_L2_ETHERNET_UPLINK + connection: local + tasks: + - name: Run failure scenario Test + block: + - name: Trigger Error + ansible.builtin.import_role: + name: arista.avd.eos_designs + rescue: + - name: Assert eos_designs failed with the expected error message + ansible.builtin.assert: + that: + - ansible_failed_result is defined + - ansible_failed_result.msg == expected_error_message + - name: Converge Negative tests for 'eos_designs_structured_config' hosts: EOS_DESIGNS_FAILURES_INCLUDED gather_facts: false diff --git a/ansible_collections/arista/avd/extensions/molecule/eos_designs_negative_unit_tests/inventory/host_vars/underlay-router-with-l2-ethernet-uplink.yml b/ansible_collections/arista/avd/extensions/molecule/eos_designs_negative_unit_tests/inventory/host_vars/underlay-router-with-l2-ethernet-uplink.yml new file mode 100644 index 00000000000..80be71f0385 --- /dev/null +++ b/ansible_collections/arista/avd/extensions/molecule/eos_designs_negative_unit_tests/inventory/host_vars/underlay-router-with-l2-ethernet-uplink.yml @@ -0,0 +1,15 @@ +--- +fabric_name: FABRIC_UNDERLAY_ROUTER_WITH_L2_ETHERNET_UPLINK + +type: l3leaf +l3leaf: + nodes: + - bgp_as: 65000 + name: underlay-router-with-l2-ethernet-uplink + id: 1 + loopback_ipv4_pool: 192.168.99.0/24 + vtep_loopback_ipv4_pool: 192.168.199.0/24 + uplink_type: l2-ethernet + +expected_error_message: >- + 'underlay_router: true' is not supported with 'uplink_type: l2-ethernet' for host 'underlay-router-with-l2-ethernet-uplink'. diff --git a/ansible_collections/arista/avd/extensions/molecule/eos_designs_negative_unit_tests/inventory/hosts.yml b/ansible_collections/arista/avd/extensions/molecule/eos_designs_negative_unit_tests/inventory/hosts.yml index 28c7d2cf795..0fd17b9982b 100644 --- a/ansible_collections/arista/avd/extensions/molecule/eos_designs_negative_unit_tests/inventory/hosts.yml +++ b/ansible_collections/arista/avd/extensions/molecule/eos_designs_negative_unit_tests/inventory/hosts.yml @@ -191,6 +191,9 @@ all: FABRIC_UNDEFINED_PEER: hosts: undefined-peer-facts: + FABRIC_UNDERLAY_ROUTER_WITH_L2_ETHERNET_UPLINK: + hosts: + underlay-router-with-l2-ethernet-uplink: FABRIC_UNDERLAY_ROUTER_WITH_PORT_CHANNEL_UPLINK: hosts: underlay-router-with-port-channel-uplink: diff --git a/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/configs/dc1-l2leaf8a.cfg b/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/configs/dc1-l2leaf8a.cfg new file mode 100644 index 00000000000..446df9166b8 --- /dev/null +++ b/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/configs/dc1-l2leaf8a.cfg @@ -0,0 +1,153 @@ +! +boot secret sha512 a153de6290ff1409257ade45f +! +no enable password +no aaa root +! +no username admin +username cvpadmin privilege 15 role network-admin secret sha512 $6$rZKcbIZ7iWGAWTUM$TCgDn1KcavS0s.OV8lacMTUkxTByfzcGlFlYUWroxYuU7M/9bIodhRO7nXGzMweUxvbk8mJmQl8Bh44cRktUj. +username cvpadmin ssh-key ssh-rsa AAAAB3NzaC1yc2EAA82spi2mkxp4FgaLi4CjWkpnL1A/MD7WhrSNgqXToF7QCb9Lidagy9IHafQxfu7LwkFdyQIMu8XNwDZIycuf29wHbDdz1N+YNVK8zwyNAbMOeKMqblsEm2YIorgjzQX1m9+/rJeFBKz77PSgeMp/Rc3txFVuSmFmeTy3aMkU= cvpadmin@hostmachine.local +username cvpadmin ssh-key secondary ssh-rsa AAAAB3NzaC1yc2EAA82spi2mkxp4FgaLi4CjWkpnL1A/MD7WhrSNgqXToF7QCb9Lidagy9IHafQxfu7LwkFdyQIMu8XNwDZIycuf29wHbDdz1N+YNVK8zwyNAbMOeKMqblsEm2YIorgjzQX1m9+/rJeFBKz77PSgeMp/Rc3txFVuSmFmeTy3aMkz= cvpadmin@hostmachine.local +! +daemon TerminAttr + exec /usr/bin/TerminAttr -cvaddr=192.168.200.11:9910 -cvauth=token,/tmp/token -cvvrf=MGMT -smashexcludes=ale,flexCounter,hardware,kni,pulse,strata -taillogs + no shutdown +! +vlan internal order ascending range 1006 1199 +! +no ip igmp snooping vlan 120 +! +transceiver qsfp default-mode 4x10G +! +service routing protocols model multi-agent +! +hostname dc1-l2leaf8a +ip name-server vrf MGMT 8.8.8.8 +ip name-server vrf MGMT 192.168.200.5 +ip name-server vrf MGMT 2001:db8::1 +ip name-server vrf MGMT 2001:db8::2 +! +snmp-server contact example@example.com +snmp-server location EOS_DESIGNS_UNIT_TESTS rackE dc1-l2leaf8a +! +spanning-tree mode mstp +spanning-tree mst 0 priority 16384 +! +vlan 110 + name Tenant_A_OP_Zone_1 +! +vlan 111 + name Tenant_A_OP_Zone_2 +! +vlan 112 + name Tenant_A_OP_Zone_3 +! +vlan 120 + name Tenant_A_WEB_Zone_1 +! +vlan 121 + name Tenant_A_WEBZone_2 +! +vlan 130 + name Tenant_A_APP_Zone_1 +! +vlan 131 + name Tenant_A_APP_Zone_2 +! +vlan 140 + name Tenant_A_DB_BZone_1 +! +vlan 141 + name Tenant_A_DB_Zone_2 +! +vlan 160 + name Tenant_A_VMOTION +! +vlan 161 + name Tenant_A_NFS +! +vlan 210 + name Tenant_B_OP_Zone_1 +! +vlan 211 + name Tenant_B_OP_Zone_2 +! +vlan 310 + name Tenant_C_OP_Zone_1 +! +vlan 311 + name Tenant_C_OP_Zone_2 +! +vlan 410 + name Tenant_D_v6_OP_Zone_1 +! +vlan 411 + name Tenant_D_v6_OP_Zone_2 +! +vlan 412 + name Tenant_D_v6_OP_Zone_1 +! +vlan 413 + name Tenant_D_v6_OP_Zone_3 +! +vlan 450 + name Tenant_D_v6_WAN_Zone_1 +! +vlan 451 + name Tenant_D_v6_WAN_Zone_2 +! +vlan 452 + name Tenant_D_v6_WAN_Zone_3 +! +vrf instance MGMT +! +management api http-commands + protocol https + no default-services + no shutdown + ! + vrf MGMT + no shutdown +! +interface Ethernet1 + description DC1-LEAF2A_Ethernet33 + no shutdown + switchport trunk allowed vlan 110-112,120-121,130-131,140-141,160-161,210-211,310-311,410-413,450-452 + switchport mode trunk + switchport +! +interface Ethernet2 + description DC1-L2LEAF8B_Ethernet1 + no shutdown + switchport trunk allowed vlan 110-112,120-121,130-131,140-141,160-161,210-211,310-311,410-413,450-452 + switchport mode trunk + switchport +! +interface Ethernet3 + description DC1-L2LEAF8D_Ethernet1 + no shutdown + switchport trunk allowed vlan 110-112,120 + switchport mode trunk + switchport +! +interface Ethernet4 + description DC1-L2LEAF8F_Ethernet1 + no shutdown + switchport trunk allowed vlan 111 + switchport mode trunk + switchport +! +interface Management1 + description OOB_MANAGEMENT + no shutdown + vrf MGMT + ip address 192.168.200.125/24 +no ip routing vrf MGMT +! +ip route vrf MGMT 0.0.0.0/0 192.168.200.5 +! +ntp local-interface vrf MGMT Management1 +ntp server vrf MGMT 192.168.200.5 prefer +ntp server vrf MGMT 2001:db8::3 +! +end diff --git a/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/configs/dc1-l2leaf8b.cfg b/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/configs/dc1-l2leaf8b.cfg new file mode 100644 index 00000000000..4acddc7eb31 --- /dev/null +++ b/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/configs/dc1-l2leaf8b.cfg @@ -0,0 +1,139 @@ +! +boot secret sha512 a153de6290ff1409257ade45f +! +no enable password +no aaa root +! +no username admin +username cvpadmin privilege 15 role network-admin secret sha512 $6$rZKcbIZ7iWGAWTUM$TCgDn1KcavS0s.OV8lacMTUkxTByfzcGlFlYUWroxYuU7M/9bIodhRO7nXGzMweUxvbk8mJmQl8Bh44cRktUj. +username cvpadmin ssh-key ssh-rsa AAAAB3NzaC1yc2EAA82spi2mkxp4FgaLi4CjWkpnL1A/MD7WhrSNgqXToF7QCb9Lidagy9IHafQxfu7LwkFdyQIMu8XNwDZIycuf29wHbDdz1N+YNVK8zwyNAbMOeKMqblsEm2YIorgjzQX1m9+/rJeFBKz77PSgeMp/Rc3txFVuSmFmeTy3aMkU= cvpadmin@hostmachine.local +username cvpadmin ssh-key secondary ssh-rsa AAAAB3NzaC1yc2EAA82spi2mkxp4FgaLi4CjWkpnL1A/MD7WhrSNgqXToF7QCb9Lidagy9IHafQxfu7LwkFdyQIMu8XNwDZIycuf29wHbDdz1N+YNVK8zwyNAbMOeKMqblsEm2YIorgjzQX1m9+/rJeFBKz77PSgeMp/Rc3txFVuSmFmeTy3aMkz= cvpadmin@hostmachine.local +! +daemon TerminAttr + exec /usr/bin/TerminAttr -cvaddr=192.168.200.11:9910 -cvauth=token,/tmp/token -cvvrf=MGMT -smashexcludes=ale,flexCounter,hardware,kni,pulse,strata -taillogs + no shutdown +! +vlan internal order ascending range 1006 1199 +! +no ip igmp snooping vlan 120 +! +transceiver qsfp default-mode 4x10G +! +service routing protocols model multi-agent +! +hostname dc1-l2leaf8b +ip name-server vrf MGMT 8.8.8.8 +ip name-server vrf MGMT 192.168.200.5 +ip name-server vrf MGMT 2001:db8::1 +ip name-server vrf MGMT 2001:db8::2 +! +snmp-server contact example@example.com +snmp-server location EOS_DESIGNS_UNIT_TESTS rackE dc1-l2leaf8b +! +spanning-tree mode mstp +spanning-tree mst 0 priority 16384 +! +vlan 110 + name Tenant_A_OP_Zone_1 +! +vlan 111 + name Tenant_A_OP_Zone_2 +! +vlan 112 + name Tenant_A_OP_Zone_3 +! +vlan 120 + name Tenant_A_WEB_Zone_1 +! +vlan 121 + name Tenant_A_WEBZone_2 +! +vlan 130 + name Tenant_A_APP_Zone_1 +! +vlan 131 + name Tenant_A_APP_Zone_2 +! +vlan 140 + name Tenant_A_DB_BZone_1 +! +vlan 141 + name Tenant_A_DB_Zone_2 +! +vlan 160 + name Tenant_A_VMOTION +! +vlan 161 + name Tenant_A_NFS +! +vlan 210 + name Tenant_B_OP_Zone_1 +! +vlan 211 + name Tenant_B_OP_Zone_2 +! +vlan 310 + name Tenant_C_OP_Zone_1 +! +vlan 311 + name Tenant_C_OP_Zone_2 +! +vlan 410 + name Tenant_D_v6_OP_Zone_1 +! +vlan 411 + name Tenant_D_v6_OP_Zone_2 +! +vlan 412 + name Tenant_D_v6_OP_Zone_1 +! +vlan 413 + name Tenant_D_v6_OP_Zone_3 +! +vlan 450 + name Tenant_D_v6_WAN_Zone_1 +! +vlan 451 + name Tenant_D_v6_WAN_Zone_2 +! +vlan 452 + name Tenant_D_v6_WAN_Zone_3 +! +vrf instance MGMT +! +management api http-commands + protocol https + no default-services + no shutdown + ! + vrf MGMT + no shutdown +! +interface Ethernet1 + description description through uplink_switch_ethernet_structured_config(dc1-l2leaf8a) + no shutdown + switchport trunk allowed vlan 110-112,120-121,130-131,140-141,160-161,210-211,310-311,410-413,450-452 + switchport mode trunk + switchport +! +interface Ethernet2 + description DC1-L2LEAF8C_Ethernet2 + no shutdown + switchport trunk allowed vlan 110-112,120-121,130-131,140-141,160-161,210-211,310-311,410-413,450-452 + switchport mode trunk + switchport +! +interface Management1 + description OOB_MANAGEMENT + no shutdown + vrf MGMT + ip address 192.168.200.126/24 +no ip routing vrf MGMT +! +ip route vrf MGMT 0.0.0.0/0 192.168.200.5 +! +ntp local-interface vrf MGMT Management1 +ntp server vrf MGMT 192.168.200.5 prefer +ntp server vrf MGMT 2001:db8::3 +! +end diff --git a/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/configs/dc1-l2leaf8c.cfg b/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/configs/dc1-l2leaf8c.cfg new file mode 100644 index 00000000000..9f6850c78b2 --- /dev/null +++ b/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/configs/dc1-l2leaf8c.cfg @@ -0,0 +1,153 @@ +! +boot secret sha512 a153de6290ff1409257ade45f +! +no enable password +no aaa root +! +no username admin +username cvpadmin privilege 15 role network-admin secret sha512 $6$rZKcbIZ7iWGAWTUM$TCgDn1KcavS0s.OV8lacMTUkxTByfzcGlFlYUWroxYuU7M/9bIodhRO7nXGzMweUxvbk8mJmQl8Bh44cRktUj. +username cvpadmin ssh-key ssh-rsa AAAAB3NzaC1yc2EAA82spi2mkxp4FgaLi4CjWkpnL1A/MD7WhrSNgqXToF7QCb9Lidagy9IHafQxfu7LwkFdyQIMu8XNwDZIycuf29wHbDdz1N+YNVK8zwyNAbMOeKMqblsEm2YIorgjzQX1m9+/rJeFBKz77PSgeMp/Rc3txFVuSmFmeTy3aMkU= cvpadmin@hostmachine.local +username cvpadmin ssh-key secondary ssh-rsa AAAAB3NzaC1yc2EAA82spi2mkxp4FgaLi4CjWkpnL1A/MD7WhrSNgqXToF7QCb9Lidagy9IHafQxfu7LwkFdyQIMu8XNwDZIycuf29wHbDdz1N+YNVK8zwyNAbMOeKMqblsEm2YIorgjzQX1m9+/rJeFBKz77PSgeMp/Rc3txFVuSmFmeTy3aMkz= cvpadmin@hostmachine.local +! +daemon TerminAttr + exec /usr/bin/TerminAttr -cvaddr=192.168.200.11:9910 -cvauth=token,/tmp/token -cvvrf=MGMT -smashexcludes=ale,flexCounter,hardware,kni,pulse,strata -taillogs + no shutdown +! +vlan internal order ascending range 1006 1199 +! +no ip igmp snooping vlan 120 +! +transceiver qsfp default-mode 4x10G +! +service routing protocols model multi-agent +! +hostname dc1-l2leaf8c +ip name-server vrf MGMT 8.8.8.8 +ip name-server vrf MGMT 192.168.200.5 +ip name-server vrf MGMT 2001:db8::1 +ip name-server vrf MGMT 2001:db8::2 +! +snmp-server contact example@example.com +snmp-server location EOS_DESIGNS_UNIT_TESTS rackE dc1-l2leaf8c +! +spanning-tree mode mstp +spanning-tree mst 0 priority 16384 +! +vlan 110 + name Tenant_A_OP_Zone_1 +! +vlan 111 + name Tenant_A_OP_Zone_2 +! +vlan 112 + name Tenant_A_OP_Zone_3 +! +vlan 120 + name Tenant_A_WEB_Zone_1 +! +vlan 121 + name Tenant_A_WEBZone_2 +! +vlan 130 + name Tenant_A_APP_Zone_1 +! +vlan 131 + name Tenant_A_APP_Zone_2 +! +vlan 140 + name Tenant_A_DB_BZone_1 +! +vlan 141 + name Tenant_A_DB_Zone_2 +! +vlan 160 + name Tenant_A_VMOTION +! +vlan 161 + name Tenant_A_NFS +! +vlan 210 + name Tenant_B_OP_Zone_1 +! +vlan 211 + name Tenant_B_OP_Zone_2 +! +vlan 310 + name Tenant_C_OP_Zone_1 +! +vlan 311 + name Tenant_C_OP_Zone_2 +! +vlan 410 + name Tenant_D_v6_OP_Zone_1 +! +vlan 411 + name Tenant_D_v6_OP_Zone_2 +! +vlan 412 + name Tenant_D_v6_OP_Zone_1 +! +vlan 413 + name Tenant_D_v6_OP_Zone_3 +! +vlan 450 + name Tenant_D_v6_WAN_Zone_1 +! +vlan 451 + name Tenant_D_v6_WAN_Zone_2 +! +vlan 452 + name Tenant_D_v6_WAN_Zone_3 +! +vrf instance MGMT +! +management api http-commands + protocol https + no default-services + no shutdown + ! + vrf MGMT + no shutdown +! +interface Ethernet1 + description DC1-LEAF2B_Ethernet33 + no shutdown + switchport trunk allowed vlan 110-112,120-121,130-131,140-141,160-161,210-211,310-311,410-413,450-452 + switchport mode trunk + switchport +! +interface Ethernet2 + description DC1-L2LEAF8B_Ethernet2 + no shutdown + switchport trunk allowed vlan 110-112,120-121,130-131,140-141,160-161,210-211,310-311,410-413,450-452 + switchport mode trunk + switchport +! +interface Ethernet3 + description DC1-L2LEAF8E_Ethernet2 + no shutdown + switchport trunk allowed vlan 110-112,120 + switchport mode trunk + switchport +! +interface Ethernet4 + description DC1-L2LEAF8G_Ethernet2 + no shutdown + switchport trunk allowed vlan 110-112,120 + switchport mode trunk + switchport +! +interface Management1 + description OOB_MANAGEMENT + no shutdown + vrf MGMT + ip address 192.168.200.127/24 +no ip routing vrf MGMT +! +ip route vrf MGMT 0.0.0.0/0 192.168.200.5 +! +ntp local-interface vrf MGMT Management1 +ntp server vrf MGMT 192.168.200.5 prefer +ntp server vrf MGMT 2001:db8::3 +! +end diff --git a/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/configs/dc1-l2leaf8d.cfg b/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/configs/dc1-l2leaf8d.cfg new file mode 100644 index 00000000000..146ce8ff4a9 --- /dev/null +++ b/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/configs/dc1-l2leaf8d.cfg @@ -0,0 +1,92 @@ +! +boot secret sha512 a153de6290ff1409257ade45f +! +no enable password +no aaa root +! +no username admin +username cvpadmin privilege 15 role network-admin secret sha512 $6$rZKcbIZ7iWGAWTUM$TCgDn1KcavS0s.OV8lacMTUkxTByfzcGlFlYUWroxYuU7M/9bIodhRO7nXGzMweUxvbk8mJmQl8Bh44cRktUj. +username cvpadmin ssh-key ssh-rsa AAAAB3NzaC1yc2EAA82spi2mkxp4FgaLi4CjWkpnL1A/MD7WhrSNgqXToF7QCb9Lidagy9IHafQxfu7LwkFdyQIMu8XNwDZIycuf29wHbDdz1N+YNVK8zwyNAbMOeKMqblsEm2YIorgjzQX1m9+/rJeFBKz77PSgeMp/Rc3txFVuSmFmeTy3aMkU= cvpadmin@hostmachine.local +username cvpadmin ssh-key secondary ssh-rsa AAAAB3NzaC1yc2EAA82spi2mkxp4FgaLi4CjWkpnL1A/MD7WhrSNgqXToF7QCb9Lidagy9IHafQxfu7LwkFdyQIMu8XNwDZIycuf29wHbDdz1N+YNVK8zwyNAbMOeKMqblsEm2YIorgjzQX1m9+/rJeFBKz77PSgeMp/Rc3txFVuSmFmeTy3aMkz= cvpadmin@hostmachine.local +! +daemon TerminAttr + exec /usr/bin/TerminAttr -cvaddr=192.168.200.11:9910 -cvauth=token,/tmp/token -cvvrf=MGMT -smashexcludes=ale,flexCounter,hardware,kni,pulse,strata -taillogs + no shutdown +! +vlan internal order ascending range 1006 1199 +! +no ip igmp snooping vlan 120 +! +transceiver qsfp default-mode 4x10G +! +service routing protocols model multi-agent +! +hostname dc1-l2leaf8d +ip name-server vrf MGMT 8.8.8.8 +ip name-server vrf MGMT 192.168.200.5 +ip name-server vrf MGMT 2001:db8::1 +ip name-server vrf MGMT 2001:db8::2 +! +snmp-server contact example@example.com +snmp-server location EOS_DESIGNS_UNIT_TESTS rackE dc1-l2leaf8d +! +spanning-tree mode mstp +spanning-tree mst 0 priority 16384 +! +vlan 110 + name Tenant_A_OP_Zone_1 +! +vlan 111 + name Tenant_A_OP_Zone_2 +! +vlan 112 + name Tenant_A_OP_Zone_3 +! +vlan 120 + name Tenant_A_WEB_Zone_1 +! +vrf instance MGMT +! +management api http-commands + protocol https + no default-services + no shutdown + ! + vrf MGMT + no shutdown +! +interface Ethernet1 + description DC1-L2LEAF8A_Ethernet3 + no shutdown + switchport trunk allowed vlan 110-112,120 + switchport mode trunk + switchport +! +interface Ethernet2 + description DC1-L2LEAF8E_Ethernet1 + no shutdown + switchport trunk allowed vlan 110-112,120 + switchport mode trunk + switchport +! +interface Ethernet10 + description Endpoint on ring topology triggering only_vlans_in_use with ring redundancy + no shutdown + switchport access vlan 111 + switchport mode access + switchport +! +interface Management1 + description OOB_MANAGEMENT + no shutdown + vrf MGMT + ip address 192.168.200.128/24 +no ip routing vrf MGMT +! +ip route vrf MGMT 0.0.0.0/0 192.168.200.5 +! +ntp local-interface vrf MGMT Management1 +ntp server vrf MGMT 192.168.200.5 prefer +ntp server vrf MGMT 2001:db8::3 +! +end diff --git a/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/configs/dc1-l2leaf8e.cfg b/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/configs/dc1-l2leaf8e.cfg new file mode 100644 index 00000000000..7002d5ab495 --- /dev/null +++ b/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/configs/dc1-l2leaf8e.cfg @@ -0,0 +1,98 @@ +! +boot secret sha512 a153de6290ff1409257ade45f +! +no enable password +no aaa root +! +no username admin +username cvpadmin privilege 15 role network-admin secret sha512 $6$rZKcbIZ7iWGAWTUM$TCgDn1KcavS0s.OV8lacMTUkxTByfzcGlFlYUWroxYuU7M/9bIodhRO7nXGzMweUxvbk8mJmQl8Bh44cRktUj. +username cvpadmin ssh-key ssh-rsa AAAAB3NzaC1yc2EAA82spi2mkxp4FgaLi4CjWkpnL1A/MD7WhrSNgqXToF7QCb9Lidagy9IHafQxfu7LwkFdyQIMu8XNwDZIycuf29wHbDdz1N+YNVK8zwyNAbMOeKMqblsEm2YIorgjzQX1m9+/rJeFBKz77PSgeMp/Rc3txFVuSmFmeTy3aMkU= cvpadmin@hostmachine.local +username cvpadmin ssh-key secondary ssh-rsa AAAAB3NzaC1yc2EAA82spi2mkxp4FgaLi4CjWkpnL1A/MD7WhrSNgqXToF7QCb9Lidagy9IHafQxfu7LwkFdyQIMu8XNwDZIycuf29wHbDdz1N+YNVK8zwyNAbMOeKMqblsEm2YIorgjzQX1m9+/rJeFBKz77PSgeMp/Rc3txFVuSmFmeTy3aMkz= cvpadmin@hostmachine.local +! +daemon TerminAttr + exec /usr/bin/TerminAttr -cvaddr=192.168.200.11:9910 -cvauth=token,/tmp/token -cvvrf=MGMT -smashexcludes=ale,flexCounter,hardware,kni,pulse,strata -taillogs + no shutdown +! +vlan internal order ascending range 1006 1199 +! +no ip igmp snooping vlan 120 +! +transceiver qsfp default-mode 4x10G +! +service routing protocols model multi-agent +! +hostname dc1-l2leaf8e +ip name-server vrf MGMT 8.8.8.8 +ip name-server vrf MGMT 192.168.200.5 +ip name-server vrf MGMT 2001:db8::1 +ip name-server vrf MGMT 2001:db8::2 +! +snmp-server contact example@example.com +snmp-server location EOS_DESIGNS_UNIT_TESTS rackE dc1-l2leaf8e +! +spanning-tree mode mstp +spanning-tree mst 0 priority 16384 +! +vlan 110 + name INBAND_MGMT +! +vlan 111 + name Tenant_A_OP_Zone_2 +! +vlan 112 + name Tenant_A_OP_Zone_3 +! +vlan 120 + name Tenant_A_WEB_Zone_1 +! +vrf instance MGMT +! +management api http-commands + protocol https + no default-services + no shutdown + ! + vrf MGMT + no shutdown +! +interface Ethernet1 + description DC1-L2LEAF8D_Ethernet2 + no shutdown + switchport trunk allowed vlan 110-112,120 + switchport mode trunk + switchport +! +interface Ethernet2 + description DC1-L2LEAF8C_Ethernet3 + no shutdown + switchport trunk allowed vlan 110-112,120 + switchport mode trunk + switchport +! +interface Ethernet10 + description Endpoint on ring topology triggering only_vlans_in_use with ring redundancy + no shutdown + switchport trunk allowed vlan 112,120 + switchport mode trunk + switchport +! +interface Management1 + description OOB_MANAGEMENT + no shutdown + vrf MGMT + ip address 192.168.200.129/24 +! +interface Vlan110 + description Inband Management + no shutdown + mtu 1500 + ip address 10.10.10.129/24 +no ip routing vrf MGMT +! +ip route vrf MGMT 0.0.0.0/0 192.168.200.5 +! +ntp local-interface vrf MGMT Management1 +ntp server vrf MGMT 192.168.200.5 prefer +ntp server vrf MGMT 2001:db8::3 +! +end diff --git a/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/configs/dc1-l2leaf8f.cfg b/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/configs/dc1-l2leaf8f.cfg new file mode 100644 index 00000000000..e5cc6332a61 --- /dev/null +++ b/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/configs/dc1-l2leaf8f.cfg @@ -0,0 +1,81 @@ +! +boot secret sha512 a153de6290ff1409257ade45f +! +no enable password +no aaa root +! +no username admin +username cvpadmin privilege 15 role network-admin secret sha512 $6$rZKcbIZ7iWGAWTUM$TCgDn1KcavS0s.OV8lacMTUkxTByfzcGlFlYUWroxYuU7M/9bIodhRO7nXGzMweUxvbk8mJmQl8Bh44cRktUj. +username cvpadmin ssh-key ssh-rsa AAAAB3NzaC1yc2EAA82spi2mkxp4FgaLi4CjWkpnL1A/MD7WhrSNgqXToF7QCb9Lidagy9IHafQxfu7LwkFdyQIMu8XNwDZIycuf29wHbDdz1N+YNVK8zwyNAbMOeKMqblsEm2YIorgjzQX1m9+/rJeFBKz77PSgeMp/Rc3txFVuSmFmeTy3aMkU= cvpadmin@hostmachine.local +username cvpadmin ssh-key secondary ssh-rsa AAAAB3NzaC1yc2EAA82spi2mkxp4FgaLi4CjWkpnL1A/MD7WhrSNgqXToF7QCb9Lidagy9IHafQxfu7LwkFdyQIMu8XNwDZIycuf29wHbDdz1N+YNVK8zwyNAbMOeKMqblsEm2YIorgjzQX1m9+/rJeFBKz77PSgeMp/Rc3txFVuSmFmeTy3aMkz= cvpadmin@hostmachine.local +! +daemon TerminAttr + exec /usr/bin/TerminAttr -cvaddr=192.168.200.11:9910 -cvauth=token,/tmp/token -cvvrf=MGMT -smashexcludes=ale,flexCounter,hardware,kni,pulse,strata -taillogs + no shutdown +! +vlan internal order ascending range 1006 1199 +! +transceiver qsfp default-mode 4x10G +! +service routing protocols model multi-agent +! +hostname dc1-l2leaf8f +ip name-server vrf MGMT 8.8.8.8 +ip name-server vrf MGMT 192.168.200.5 +ip name-server vrf MGMT 2001:db8::1 +ip name-server vrf MGMT 2001:db8::2 +! +snmp-server contact example@example.com +snmp-server location EOS_DESIGNS_UNIT_TESTS rackE dc1-l2leaf8f +! +spanning-tree mode mstp +spanning-tree mst 0 priority 16384 +! +vlan 111 + name Tenant_A_OP_Zone_2 +! +vrf instance MGMT +! +management api http-commands + protocol https + no default-services + no shutdown + ! + vrf MGMT + no shutdown +! +interface Ethernet1 + description DC1-L2LEAF8A_Ethernet4 + no shutdown + switchport trunk allowed vlan 111 + switchport mode trunk + switchport +! +interface Ethernet2 + description DC1-L2LEAF8G_Ethernet1 + no shutdown + switchport trunk allowed vlan 111 + switchport mode trunk + switchport +! +interface Ethernet10 + description Endpoint on ring topology triggering only_vlans_in_use with ring redundancy + no shutdown + switchport access vlan 111 + switchport mode access + switchport +! +interface Management1 + description OOB_MANAGEMENT + no shutdown + vrf MGMT + ip address 192.168.200.130/24 +no ip routing vrf MGMT +! +ip route vrf MGMT 0.0.0.0/0 192.168.200.5 +! +ntp local-interface vrf MGMT Management1 +ntp server vrf MGMT 192.168.200.5 prefer +ntp server vrf MGMT 2001:db8::3 +! +end diff --git a/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/configs/dc1-l2leaf8g.cfg b/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/configs/dc1-l2leaf8g.cfg new file mode 100644 index 00000000000..75a85ea4b78 --- /dev/null +++ b/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/configs/dc1-l2leaf8g.cfg @@ -0,0 +1,98 @@ +! +boot secret sha512 a153de6290ff1409257ade45f +! +no enable password +no aaa root +! +no username admin +username cvpadmin privilege 15 role network-admin secret sha512 $6$rZKcbIZ7iWGAWTUM$TCgDn1KcavS0s.OV8lacMTUkxTByfzcGlFlYUWroxYuU7M/9bIodhRO7nXGzMweUxvbk8mJmQl8Bh44cRktUj. +username cvpadmin ssh-key ssh-rsa AAAAB3NzaC1yc2EAA82spi2mkxp4FgaLi4CjWkpnL1A/MD7WhrSNgqXToF7QCb9Lidagy9IHafQxfu7LwkFdyQIMu8XNwDZIycuf29wHbDdz1N+YNVK8zwyNAbMOeKMqblsEm2YIorgjzQX1m9+/rJeFBKz77PSgeMp/Rc3txFVuSmFmeTy3aMkU= cvpadmin@hostmachine.local +username cvpadmin ssh-key secondary ssh-rsa AAAAB3NzaC1yc2EAA82spi2mkxp4FgaLi4CjWkpnL1A/MD7WhrSNgqXToF7QCb9Lidagy9IHafQxfu7LwkFdyQIMu8XNwDZIycuf29wHbDdz1N+YNVK8zwyNAbMOeKMqblsEm2YIorgjzQX1m9+/rJeFBKz77PSgeMp/Rc3txFVuSmFmeTy3aMkz= cvpadmin@hostmachine.local +! +daemon TerminAttr + exec /usr/bin/TerminAttr -cvaddr=192.168.200.11:9910 -cvauth=token,/tmp/token -cvvrf=MGMT -smashexcludes=ale,flexCounter,hardware,kni,pulse,strata -taillogs + no shutdown +! +vlan internal order ascending range 1006 1199 +! +no ip igmp snooping vlan 120 +! +transceiver qsfp default-mode 4x10G +! +service routing protocols model multi-agent +! +hostname dc1-l2leaf8g +ip name-server vrf MGMT 8.8.8.8 +ip name-server vrf MGMT 192.168.200.5 +ip name-server vrf MGMT 2001:db8::1 +ip name-server vrf MGMT 2001:db8::2 +! +snmp-server contact example@example.com +snmp-server location EOS_DESIGNS_UNIT_TESTS rackE dc1-l2leaf8g +! +spanning-tree mode mstp +spanning-tree mst 0 priority 16384 +! +vlan 110 + name INBAND_MGMT +! +vlan 111 + name Tenant_A_OP_Zone_2 +! +vlan 112 + name Tenant_A_OP_Zone_3 +! +vlan 120 + name Tenant_A_WEB_Zone_1 +! +vrf instance MGMT +! +management api http-commands + protocol https + no default-services + no shutdown + ! + vrf MGMT + no shutdown +! +interface Ethernet1 + description DC1-L2LEAF8F_Ethernet2 + no shutdown + switchport trunk allowed vlan 111 + switchport mode trunk + switchport +! +interface Ethernet2 + description DC1-L2LEAF8C_Ethernet4 + no shutdown + switchport trunk allowed vlan 110-112,120 + switchport mode trunk + switchport +! +interface Ethernet10 + description Endpoint on ring topology triggering only_vlans_in_use with ring redundancy + no shutdown + switchport trunk allowed vlan 112,120 + switchport mode trunk + switchport +! +interface Management1 + description OOB_MANAGEMENT + no shutdown + vrf MGMT + ip address 192.168.200.131/24 +! +interface Vlan110 + description Inband Management + no shutdown + mtu 1500 + ip address 10.10.10.131/24 +no ip routing vrf MGMT +! +ip route vrf MGMT 0.0.0.0/0 192.168.200.5 +! +ntp local-interface vrf MGMT Management1 +ntp server vrf MGMT 192.168.200.5 prefer +ntp server vrf MGMT 2001:db8::3 +! +end diff --git a/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/configs/dc1-leaf2a.cfg b/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/configs/dc1-leaf2a.cfg index 1220c557134..14e621cc329 100644 --- a/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/configs/dc1-leaf2a.cfg +++ b/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/configs/dc1-leaf2a.cfg @@ -382,6 +382,14 @@ interface Ethernet32 no shutdown channel-group 32 mode active ! +interface Ethernet33 + description description through uplink_switch_ethernet_structured_config(dc1-l2leaf8a) + no shutdown + switchport trunk allowed vlan 110-112,120-121,130-131,140-141,160-161,210-211,310-311,410-413,450-452 + switchport mode trunk + switchport + link tracking group l2leaf-server01 downstream +! interface Ethernet49/1 description P2P_LINK_Ethernet49/1_TO_DC1-SPINE1_Ethernet3/1 no shutdown diff --git a/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/configs/dc1-leaf2b.cfg b/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/configs/dc1-leaf2b.cfg index f35c27d0652..c9ce34bc3c8 100644 --- a/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/configs/dc1-leaf2b.cfg +++ b/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/configs/dc1-leaf2b.cfg @@ -331,6 +331,14 @@ interface Ethernet31 no shutdown channel-group 30 mode active ! +interface Ethernet33 + description DC1-L2LEAF8C_Ethernet1 + no shutdown + switchport trunk allowed vlan 110-112,120-121,130-131,140-141,160-161,210-211,310-311,410-413,450-452 + switchport mode trunk + switchport + link tracking group LT_GROUP1 downstream +! interface Ethernet49/1 description P2P_LINK_Ethernet49/1_TO_DC1-SPINE1_Ethernet5/1 no shutdown diff --git a/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/structured_configs/dc1-l2leaf8a.yml b/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/structured_configs/dc1-l2leaf8a.yml new file mode 100644 index 00000000000..3eaa6e5bbb1 --- /dev/null +++ b/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/structured_configs/dc1-l2leaf8a.yml @@ -0,0 +1,251 @@ +aaa_root: + disabled: true +boot: + secret: + key: a153de6290ff1409257ade45f +config_end: true +daemon_terminattr: + cvaddrs: + - 192.168.200.11:9910 + cvauth: + method: token + token_file: /tmp/token + cvvrf: MGMT + disable_aaa: false + smashexcludes: ale,flexCounter,hardware,kni,pulse,strata +enable_password: + disabled: true +ethernet_interfaces: +- name: Ethernet1 + description: DC1-LEAF2A_Ethernet33 + shutdown: false + metadata: + peer: dc1-leaf2a + peer_interface: Ethernet33 + peer_type: l3leaf + switchport: + enabled: true + mode: trunk + trunk: + allowed_vlan: 110-112,120-121,130-131,140-141,160-161,210-211,310-311,410-413,450-452 +- name: Ethernet2 + description: DC1-L2LEAF8B_Ethernet1 + shutdown: false + metadata: + peer: dc1-l2leaf8b + peer_interface: Ethernet1 + peer_type: l2leaf + switchport: + enabled: true + mode: trunk + trunk: + allowed_vlan: 110-112,120-121,130-131,140-141,160-161,210-211,310-311,410-413,450-452 +- name: Ethernet3 + description: DC1-L2LEAF8D_Ethernet1 + shutdown: false + metadata: + peer: dc1-l2leaf8d + peer_interface: Ethernet1 + peer_type: l2leaf + switchport: + enabled: true + mode: trunk + trunk: + allowed_vlan: 110-112,120 +- name: Ethernet4 + description: DC1-L2LEAF8F_Ethernet1 + shutdown: false + metadata: + peer: dc1-l2leaf8f + peer_interface: Ethernet1 + peer_type: l2leaf + switchport: + enabled: true + mode: trunk + trunk: + allowed_vlan: '111' +hostname: dc1-l2leaf8a +ip_igmp_snooping: + globally_enabled: true + vlans: + - id: 120 + enabled: false +ip_name_server: + vrfs: + - name: MGMT + servers: + - ip_address: 192.168.200.5 + - ip_address: 8.8.8.8 + - ip_address: 2001:db8::1 + - ip_address: 2001:db8::2 +local_users: +- name: admin + disabled: true +- name: cvpadmin + privilege: 15 + role: network-admin + sha512_password: $6$rZKcbIZ7iWGAWTUM$TCgDn1KcavS0s.OV8lacMTUkxTByfzcGlFlYUWroxYuU7M/9bIodhRO7nXGzMweUxvbk8mJmQl8Bh44cRktUj. + ssh_key: ssh-rsa AAAAB3NzaC1yc2EAA82spi2mkxp4FgaLi4CjWkpnL1A/MD7WhrSNgqXToF7QCb9Lidagy9IHafQxfu7LwkFdyQIMu8XNwDZIycuf29wHbDdz1N+YNVK8zwyNAbMOeKMqblsEm2YIorgjzQX1m9+/rJeFBKz77PSgeMp/Rc3txFVuSmFmeTy3aMkU= + cvpadmin@hostmachine.local + secondary_ssh_key: ssh-rsa AAAAB3NzaC1yc2EAA82spi2mkxp4FgaLi4CjWkpnL1A/MD7WhrSNgqXToF7QCb9Lidagy9IHafQxfu7LwkFdyQIMu8XNwDZIycuf29wHbDdz1N+YNVK8zwyNAbMOeKMqblsEm2YIorgjzQX1m9+/rJeFBKz77PSgeMp/Rc3txFVuSmFmeTy3aMkz= + cvpadmin@hostmachine.local +management_api_http: + enable_https: true + default_services: false + enable_vrfs: + - name: MGMT +management_interfaces: +- name: Management1 + description: OOB_MANAGEMENT + shutdown: false + vrf: MGMT + ip_address: 192.168.200.125/24 + type: oob + gateway: 192.168.200.5 +metadata: + is_deployed: true + platform: vEOS-LAB + rack: rackE + fabric_name: EOS_DESIGNS_UNIT_TESTS +ntp: + local_interface: + name: Management1 + vrf: MGMT + servers: + - name: 192.168.200.5 + preferred: true + - name: 2001:db8::3 + vrf: MGMT +service_routing_protocols_model: multi-agent +snmp_server: + contact: example@example.com + location: EOS_DESIGNS_UNIT_TESTS rackE dc1-l2leaf8a +spanning_tree: + mode: mstp + mst_instances: + - id: '0' + priority: 16384 +static_routes: +- vrf: MGMT + prefix: 0.0.0.0/0 + next_hop: 192.168.200.5 +transceiver_qsfp_default_mode_4x10: true +vlan_internal_order: + allocation: ascending + range: + beginning: 1006 + ending: 1199 +vlans: +- id: 130 + name: Tenant_A_APP_Zone_1 + metadata: + tenants: + - Tenant_A +- id: 131 + name: Tenant_A_APP_Zone_2 + metadata: + tenants: + - Tenant_A +- id: 140 + name: Tenant_A_DB_BZone_1 + metadata: + tenants: + - Tenant_A +- id: 141 + name: Tenant_A_DB_Zone_2 + metadata: + tenants: + - Tenant_A +- id: 110 + name: Tenant_A_OP_Zone_1 + metadata: + tenants: + - Tenant_A +- id: 111 + name: Tenant_A_OP_Zone_2 + metadata: + tenants: + - Tenant_A +- id: 112 + name: Tenant_A_OP_Zone_3 + metadata: + tenants: + - Tenant_A +- id: 120 + name: Tenant_A_WEB_Zone_1 + metadata: + tenants: + - Tenant_A +- id: 121 + name: Tenant_A_WEBZone_2 + metadata: + tenants: + - Tenant_A +- id: 160 + name: Tenant_A_VMOTION + metadata: + tenants: + - Tenant_A +- id: 161 + name: Tenant_A_NFS + metadata: + tenants: + - Tenant_A +- id: 210 + name: Tenant_B_OP_Zone_1 + metadata: + tenants: + - Tenant_B +- id: 211 + name: Tenant_B_OP_Zone_2 + metadata: + tenants: + - Tenant_B +- id: 310 + name: Tenant_C_OP_Zone_1 + metadata: + tenants: + - Tenant_C +- id: 311 + name: Tenant_C_OP_Zone_2 + metadata: + tenants: + - Tenant_C +- id: 450 + name: Tenant_D_v6_WAN_Zone_1 + metadata: + tenants: + - Tenant_D +- id: 451 + name: Tenant_D_v6_WAN_Zone_2 + metadata: + tenants: + - Tenant_D +- id: 452 + name: Tenant_D_v6_WAN_Zone_3 + metadata: + tenants: + - Tenant_D +- id: 410 + name: Tenant_D_v6_OP_Zone_1 + metadata: + tenants: + - Tenant_D +- id: 411 + name: Tenant_D_v6_OP_Zone_2 + metadata: + tenants: + - Tenant_D +- id: 412 + name: Tenant_D_v6_OP_Zone_1 + metadata: + tenants: + - Tenant_D +- id: 413 + name: Tenant_D_v6_OP_Zone_3 + metadata: + tenants: + - Tenant_D +vrfs: +- name: MGMT + ip_routing: false diff --git a/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/structured_configs/dc1-l2leaf8b.yml b/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/structured_configs/dc1-l2leaf8b.yml new file mode 100644 index 00000000000..d86c742370f --- /dev/null +++ b/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/structured_configs/dc1-l2leaf8b.yml @@ -0,0 +1,227 @@ +aaa_root: + disabled: true +boot: + secret: + key: a153de6290ff1409257ade45f +config_end: true +daemon_terminattr: + cvaddrs: + - 192.168.200.11:9910 + cvauth: + method: token + token_file: /tmp/token + cvvrf: MGMT + disable_aaa: false + smashexcludes: ale,flexCounter,hardware,kni,pulse,strata +enable_password: + disabled: true +ethernet_interfaces: +- name: Ethernet1 + description: description through uplink_switch_ethernet_structured_config(dc1-l2leaf8a) + shutdown: false + metadata: + peer: dc1-l2leaf8a + peer_interface: Ethernet2 + peer_type: l2leaf + switchport: + enabled: true + mode: trunk + trunk: + allowed_vlan: 110-112,120-121,130-131,140-141,160-161,210-211,310-311,410-413,450-452 +- name: Ethernet2 + description: DC1-L2LEAF8C_Ethernet2 + shutdown: false + metadata: + peer: dc1-l2leaf8c + peer_interface: Ethernet2 + peer_type: l2leaf + switchport: + enabled: true + mode: trunk + trunk: + allowed_vlan: 110-112,120-121,130-131,140-141,160-161,210-211,310-311,410-413,450-452 +hostname: dc1-l2leaf8b +ip_igmp_snooping: + globally_enabled: true + vlans: + - id: 120 + enabled: false +ip_name_server: + vrfs: + - name: MGMT + servers: + - ip_address: 192.168.200.5 + - ip_address: 8.8.8.8 + - ip_address: 2001:db8::1 + - ip_address: 2001:db8::2 +local_users: +- name: admin + disabled: true +- name: cvpadmin + privilege: 15 + role: network-admin + sha512_password: $6$rZKcbIZ7iWGAWTUM$TCgDn1KcavS0s.OV8lacMTUkxTByfzcGlFlYUWroxYuU7M/9bIodhRO7nXGzMweUxvbk8mJmQl8Bh44cRktUj. + ssh_key: ssh-rsa AAAAB3NzaC1yc2EAA82spi2mkxp4FgaLi4CjWkpnL1A/MD7WhrSNgqXToF7QCb9Lidagy9IHafQxfu7LwkFdyQIMu8XNwDZIycuf29wHbDdz1N+YNVK8zwyNAbMOeKMqblsEm2YIorgjzQX1m9+/rJeFBKz77PSgeMp/Rc3txFVuSmFmeTy3aMkU= + cvpadmin@hostmachine.local + secondary_ssh_key: ssh-rsa AAAAB3NzaC1yc2EAA82spi2mkxp4FgaLi4CjWkpnL1A/MD7WhrSNgqXToF7QCb9Lidagy9IHafQxfu7LwkFdyQIMu8XNwDZIycuf29wHbDdz1N+YNVK8zwyNAbMOeKMqblsEm2YIorgjzQX1m9+/rJeFBKz77PSgeMp/Rc3txFVuSmFmeTy3aMkz= + cvpadmin@hostmachine.local +management_api_http: + enable_https: true + default_services: false + enable_vrfs: + - name: MGMT +management_interfaces: +- name: Management1 + description: OOB_MANAGEMENT + shutdown: false + vrf: MGMT + ip_address: 192.168.200.126/24 + type: oob + gateway: 192.168.200.5 +metadata: + is_deployed: true + platform: vEOS-LAB + rack: rackE + fabric_name: EOS_DESIGNS_UNIT_TESTS +ntp: + local_interface: + name: Management1 + vrf: MGMT + servers: + - name: 192.168.200.5 + preferred: true + - name: 2001:db8::3 + vrf: MGMT +service_routing_protocols_model: multi-agent +snmp_server: + contact: example@example.com + location: EOS_DESIGNS_UNIT_TESTS rackE dc1-l2leaf8b +spanning_tree: + mode: mstp + mst_instances: + - id: '0' + priority: 16384 +static_routes: +- vrf: MGMT + prefix: 0.0.0.0/0 + next_hop: 192.168.200.5 +transceiver_qsfp_default_mode_4x10: true +vlan_internal_order: + allocation: ascending + range: + beginning: 1006 + ending: 1199 +vlans: +- id: 130 + name: Tenant_A_APP_Zone_1 + metadata: + tenants: + - Tenant_A +- id: 131 + name: Tenant_A_APP_Zone_2 + metadata: + tenants: + - Tenant_A +- id: 140 + name: Tenant_A_DB_BZone_1 + metadata: + tenants: + - Tenant_A +- id: 141 + name: Tenant_A_DB_Zone_2 + metadata: + tenants: + - Tenant_A +- id: 110 + name: Tenant_A_OP_Zone_1 + metadata: + tenants: + - Tenant_A +- id: 111 + name: Tenant_A_OP_Zone_2 + metadata: + tenants: + - Tenant_A +- id: 112 + name: Tenant_A_OP_Zone_3 + metadata: + tenants: + - Tenant_A +- id: 120 + name: Tenant_A_WEB_Zone_1 + metadata: + tenants: + - Tenant_A +- id: 121 + name: Tenant_A_WEBZone_2 + metadata: + tenants: + - Tenant_A +- id: 160 + name: Tenant_A_VMOTION + metadata: + tenants: + - Tenant_A +- id: 161 + name: Tenant_A_NFS + metadata: + tenants: + - Tenant_A +- id: 210 + name: Tenant_B_OP_Zone_1 + metadata: + tenants: + - Tenant_B +- id: 211 + name: Tenant_B_OP_Zone_2 + metadata: + tenants: + - Tenant_B +- id: 310 + name: Tenant_C_OP_Zone_1 + metadata: + tenants: + - Tenant_C +- id: 311 + name: Tenant_C_OP_Zone_2 + metadata: + tenants: + - Tenant_C +- id: 450 + name: Tenant_D_v6_WAN_Zone_1 + metadata: + tenants: + - Tenant_D +- id: 451 + name: Tenant_D_v6_WAN_Zone_2 + metadata: + tenants: + - Tenant_D +- id: 452 + name: Tenant_D_v6_WAN_Zone_3 + metadata: + tenants: + - Tenant_D +- id: 410 + name: Tenant_D_v6_OP_Zone_1 + metadata: + tenants: + - Tenant_D +- id: 411 + name: Tenant_D_v6_OP_Zone_2 + metadata: + tenants: + - Tenant_D +- id: 412 + name: Tenant_D_v6_OP_Zone_1 + metadata: + tenants: + - Tenant_D +- id: 413 + name: Tenant_D_v6_OP_Zone_3 + metadata: + tenants: + - Tenant_D +vrfs: +- name: MGMT + ip_routing: false diff --git a/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/structured_configs/dc1-l2leaf8c.yml b/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/structured_configs/dc1-l2leaf8c.yml new file mode 100644 index 00000000000..90ac48b9298 --- /dev/null +++ b/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/structured_configs/dc1-l2leaf8c.yml @@ -0,0 +1,251 @@ +aaa_root: + disabled: true +boot: + secret: + key: a153de6290ff1409257ade45f +config_end: true +daemon_terminattr: + cvaddrs: + - 192.168.200.11:9910 + cvauth: + method: token + token_file: /tmp/token + cvvrf: MGMT + disable_aaa: false + smashexcludes: ale,flexCounter,hardware,kni,pulse,strata +enable_password: + disabled: true +ethernet_interfaces: +- name: Ethernet1 + description: DC1-LEAF2B_Ethernet33 + shutdown: false + metadata: + peer: dc1-leaf2b + peer_interface: Ethernet33 + peer_type: l3leaf + switchport: + enabled: true + mode: trunk + trunk: + allowed_vlan: 110-112,120-121,130-131,140-141,160-161,210-211,310-311,410-413,450-452 +- name: Ethernet2 + description: DC1-L2LEAF8B_Ethernet2 + shutdown: false + metadata: + peer: dc1-l2leaf8b + peer_interface: Ethernet2 + peer_type: l2leaf + switchport: + enabled: true + mode: trunk + trunk: + allowed_vlan: 110-112,120-121,130-131,140-141,160-161,210-211,310-311,410-413,450-452 +- name: Ethernet3 + description: DC1-L2LEAF8E_Ethernet2 + shutdown: false + metadata: + peer: dc1-l2leaf8e + peer_interface: Ethernet2 + peer_type: l2leaf + switchport: + enabled: true + mode: trunk + trunk: + allowed_vlan: 110-112,120 +- name: Ethernet4 + description: DC1-L2LEAF8G_Ethernet2 + shutdown: false + metadata: + peer: dc1-l2leaf8g + peer_interface: Ethernet2 + peer_type: l2leaf + switchport: + enabled: true + mode: trunk + trunk: + allowed_vlan: 110-112,120 +hostname: dc1-l2leaf8c +ip_igmp_snooping: + globally_enabled: true + vlans: + - id: 120 + enabled: false +ip_name_server: + vrfs: + - name: MGMT + servers: + - ip_address: 192.168.200.5 + - ip_address: 8.8.8.8 + - ip_address: 2001:db8::1 + - ip_address: 2001:db8::2 +local_users: +- name: admin + disabled: true +- name: cvpadmin + privilege: 15 + role: network-admin + sha512_password: $6$rZKcbIZ7iWGAWTUM$TCgDn1KcavS0s.OV8lacMTUkxTByfzcGlFlYUWroxYuU7M/9bIodhRO7nXGzMweUxvbk8mJmQl8Bh44cRktUj. + ssh_key: ssh-rsa AAAAB3NzaC1yc2EAA82spi2mkxp4FgaLi4CjWkpnL1A/MD7WhrSNgqXToF7QCb9Lidagy9IHafQxfu7LwkFdyQIMu8XNwDZIycuf29wHbDdz1N+YNVK8zwyNAbMOeKMqblsEm2YIorgjzQX1m9+/rJeFBKz77PSgeMp/Rc3txFVuSmFmeTy3aMkU= + cvpadmin@hostmachine.local + secondary_ssh_key: ssh-rsa AAAAB3NzaC1yc2EAA82spi2mkxp4FgaLi4CjWkpnL1A/MD7WhrSNgqXToF7QCb9Lidagy9IHafQxfu7LwkFdyQIMu8XNwDZIycuf29wHbDdz1N+YNVK8zwyNAbMOeKMqblsEm2YIorgjzQX1m9+/rJeFBKz77PSgeMp/Rc3txFVuSmFmeTy3aMkz= + cvpadmin@hostmachine.local +management_api_http: + enable_https: true + default_services: false + enable_vrfs: + - name: MGMT +management_interfaces: +- name: Management1 + description: OOB_MANAGEMENT + shutdown: false + vrf: MGMT + ip_address: 192.168.200.127/24 + type: oob + gateway: 192.168.200.5 +metadata: + is_deployed: true + platform: vEOS-LAB + rack: rackE + fabric_name: EOS_DESIGNS_UNIT_TESTS +ntp: + local_interface: + name: Management1 + vrf: MGMT + servers: + - name: 192.168.200.5 + preferred: true + - name: 2001:db8::3 + vrf: MGMT +service_routing_protocols_model: multi-agent +snmp_server: + contact: example@example.com + location: EOS_DESIGNS_UNIT_TESTS rackE dc1-l2leaf8c +spanning_tree: + mode: mstp + mst_instances: + - id: '0' + priority: 16384 +static_routes: +- vrf: MGMT + prefix: 0.0.0.0/0 + next_hop: 192.168.200.5 +transceiver_qsfp_default_mode_4x10: true +vlan_internal_order: + allocation: ascending + range: + beginning: 1006 + ending: 1199 +vlans: +- id: 130 + name: Tenant_A_APP_Zone_1 + metadata: + tenants: + - Tenant_A +- id: 131 + name: Tenant_A_APP_Zone_2 + metadata: + tenants: + - Tenant_A +- id: 140 + name: Tenant_A_DB_BZone_1 + metadata: + tenants: + - Tenant_A +- id: 141 + name: Tenant_A_DB_Zone_2 + metadata: + tenants: + - Tenant_A +- id: 110 + name: Tenant_A_OP_Zone_1 + metadata: + tenants: + - Tenant_A +- id: 111 + name: Tenant_A_OP_Zone_2 + metadata: + tenants: + - Tenant_A +- id: 112 + name: Tenant_A_OP_Zone_3 + metadata: + tenants: + - Tenant_A +- id: 120 + name: Tenant_A_WEB_Zone_1 + metadata: + tenants: + - Tenant_A +- id: 121 + name: Tenant_A_WEBZone_2 + metadata: + tenants: + - Tenant_A +- id: 160 + name: Tenant_A_VMOTION + metadata: + tenants: + - Tenant_A +- id: 161 + name: Tenant_A_NFS + metadata: + tenants: + - Tenant_A +- id: 210 + name: Tenant_B_OP_Zone_1 + metadata: + tenants: + - Tenant_B +- id: 211 + name: Tenant_B_OP_Zone_2 + metadata: + tenants: + - Tenant_B +- id: 310 + name: Tenant_C_OP_Zone_1 + metadata: + tenants: + - Tenant_C +- id: 311 + name: Tenant_C_OP_Zone_2 + metadata: + tenants: + - Tenant_C +- id: 450 + name: Tenant_D_v6_WAN_Zone_1 + metadata: + tenants: + - Tenant_D +- id: 451 + name: Tenant_D_v6_WAN_Zone_2 + metadata: + tenants: + - Tenant_D +- id: 452 + name: Tenant_D_v6_WAN_Zone_3 + metadata: + tenants: + - Tenant_D +- id: 410 + name: Tenant_D_v6_OP_Zone_1 + metadata: + tenants: + - Tenant_D +- id: 411 + name: Tenant_D_v6_OP_Zone_2 + metadata: + tenants: + - Tenant_D +- id: 412 + name: Tenant_D_v6_OP_Zone_1 + metadata: + tenants: + - Tenant_D +- id: 413 + name: Tenant_D_v6_OP_Zone_3 + metadata: + tenants: + - Tenant_D +vrfs: +- name: MGMT + ip_routing: false diff --git a/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/structured_configs/dc1-l2leaf8d.yml b/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/structured_configs/dc1-l2leaf8d.yml new file mode 100644 index 00000000000..b31da1fbc20 --- /dev/null +++ b/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/structured_configs/dc1-l2leaf8d.yml @@ -0,0 +1,147 @@ +aaa_root: + disabled: true +boot: + secret: + key: a153de6290ff1409257ade45f +config_end: true +daemon_terminattr: + cvaddrs: + - 192.168.200.11:9910 + cvauth: + method: token + token_file: /tmp/token + cvvrf: MGMT + disable_aaa: false + smashexcludes: ale,flexCounter,hardware,kni,pulse,strata +enable_password: + disabled: true +ethernet_interfaces: +- name: Ethernet1 + description: DC1-L2LEAF8A_Ethernet3 + shutdown: false + metadata: + peer: dc1-l2leaf8a + peer_interface: Ethernet3 + peer_type: l2leaf + switchport: + enabled: true + mode: trunk + trunk: + allowed_vlan: 110-112,120 +- name: Ethernet2 + description: DC1-L2LEAF8E_Ethernet1 + shutdown: false + metadata: + peer: dc1-l2leaf8e + peer_interface: Ethernet1 + peer_type: l2leaf + switchport: + enabled: true + mode: trunk + trunk: + allowed_vlan: 110-112,120 +- name: Ethernet10 + description: Endpoint on ring topology triggering only_vlans_in_use with ring redundancy + shutdown: false + metadata: + peer_type: network_port + peer_key: network_ports + switchport: + enabled: true + mode: access + access_vlan: 111 +hostname: dc1-l2leaf8d +ip_igmp_snooping: + globally_enabled: true + vlans: + - id: 120 + enabled: false +ip_name_server: + vrfs: + - name: MGMT + servers: + - ip_address: 192.168.200.5 + - ip_address: 8.8.8.8 + - ip_address: 2001:db8::1 + - ip_address: 2001:db8::2 +local_users: +- name: admin + disabled: true +- name: cvpadmin + privilege: 15 + role: network-admin + sha512_password: $6$rZKcbIZ7iWGAWTUM$TCgDn1KcavS0s.OV8lacMTUkxTByfzcGlFlYUWroxYuU7M/9bIodhRO7nXGzMweUxvbk8mJmQl8Bh44cRktUj. + ssh_key: ssh-rsa AAAAB3NzaC1yc2EAA82spi2mkxp4FgaLi4CjWkpnL1A/MD7WhrSNgqXToF7QCb9Lidagy9IHafQxfu7LwkFdyQIMu8XNwDZIycuf29wHbDdz1N+YNVK8zwyNAbMOeKMqblsEm2YIorgjzQX1m9+/rJeFBKz77PSgeMp/Rc3txFVuSmFmeTy3aMkU= + cvpadmin@hostmachine.local + secondary_ssh_key: ssh-rsa AAAAB3NzaC1yc2EAA82spi2mkxp4FgaLi4CjWkpnL1A/MD7WhrSNgqXToF7QCb9Lidagy9IHafQxfu7LwkFdyQIMu8XNwDZIycuf29wHbDdz1N+YNVK8zwyNAbMOeKMqblsEm2YIorgjzQX1m9+/rJeFBKz77PSgeMp/Rc3txFVuSmFmeTy3aMkz= + cvpadmin@hostmachine.local +management_api_http: + enable_https: true + default_services: false + enable_vrfs: + - name: MGMT +management_interfaces: +- name: Management1 + description: OOB_MANAGEMENT + shutdown: false + vrf: MGMT + ip_address: 192.168.200.128/24 + type: oob + gateway: 192.168.200.5 +metadata: + is_deployed: true + platform: vEOS-LAB + rack: rackE + fabric_name: EOS_DESIGNS_UNIT_TESTS +ntp: + local_interface: + name: Management1 + vrf: MGMT + servers: + - name: 192.168.200.5 + preferred: true + - name: 2001:db8::3 + vrf: MGMT +service_routing_protocols_model: multi-agent +snmp_server: + contact: example@example.com + location: EOS_DESIGNS_UNIT_TESTS rackE dc1-l2leaf8d +spanning_tree: + mode: mstp + mst_instances: + - id: '0' + priority: 16384 +static_routes: +- vrf: MGMT + prefix: 0.0.0.0/0 + next_hop: 192.168.200.5 +transceiver_qsfp_default_mode_4x10: true +vlan_internal_order: + allocation: ascending + range: + beginning: 1006 + ending: 1199 +vlans: +- id: 110 + name: Tenant_A_OP_Zone_1 + metadata: + tenants: + - Tenant_A +- id: 111 + name: Tenant_A_OP_Zone_2 + metadata: + tenants: + - Tenant_A +- id: 112 + name: Tenant_A_OP_Zone_3 + metadata: + tenants: + - Tenant_A +- id: 120 + name: Tenant_A_WEB_Zone_1 + metadata: + tenants: + - Tenant_A +vrfs: +- name: MGMT + ip_routing: false diff --git a/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/structured_configs/dc1-l2leaf8e.yml b/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/structured_configs/dc1-l2leaf8e.yml new file mode 100644 index 00000000000..5365f7b4e24 --- /dev/null +++ b/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/structured_configs/dc1-l2leaf8e.yml @@ -0,0 +1,157 @@ +aaa_root: + disabled: true +boot: + secret: + key: a153de6290ff1409257ade45f +config_end: true +daemon_terminattr: + cvaddrs: + - 192.168.200.11:9910 + cvauth: + method: token + token_file: /tmp/token + cvvrf: MGMT + disable_aaa: false + smashexcludes: ale,flexCounter,hardware,kni,pulse,strata +enable_password: + disabled: true +ethernet_interfaces: +- name: Ethernet1 + description: DC1-L2LEAF8D_Ethernet2 + shutdown: false + metadata: + peer: dc1-l2leaf8d + peer_interface: Ethernet2 + peer_type: l2leaf + switchport: + enabled: true + mode: trunk + trunk: + allowed_vlan: 110-112,120 +- name: Ethernet2 + description: DC1-L2LEAF8C_Ethernet3 + shutdown: false + metadata: + peer: dc1-l2leaf8c + peer_interface: Ethernet3 + peer_type: l2leaf + switchport: + enabled: true + mode: trunk + trunk: + allowed_vlan: 110-112,120 +- name: Ethernet10 + description: Endpoint on ring topology triggering only_vlans_in_use with ring redundancy + shutdown: false + metadata: + peer_type: network_port + peer_key: network_ports + switchport: + enabled: true + mode: trunk + trunk: + allowed_vlan: 112,120 +hostname: dc1-l2leaf8e +ip_igmp_snooping: + globally_enabled: true + vlans: + - id: 120 + enabled: false +ip_name_server: + vrfs: + - name: MGMT + servers: + - ip_address: 192.168.200.5 + - ip_address: 8.8.8.8 + - ip_address: 2001:db8::1 + - ip_address: 2001:db8::2 +local_users: +- name: admin + disabled: true +- name: cvpadmin + privilege: 15 + role: network-admin + sha512_password: $6$rZKcbIZ7iWGAWTUM$TCgDn1KcavS0s.OV8lacMTUkxTByfzcGlFlYUWroxYuU7M/9bIodhRO7nXGzMweUxvbk8mJmQl8Bh44cRktUj. + ssh_key: ssh-rsa AAAAB3NzaC1yc2EAA82spi2mkxp4FgaLi4CjWkpnL1A/MD7WhrSNgqXToF7QCb9Lidagy9IHafQxfu7LwkFdyQIMu8XNwDZIycuf29wHbDdz1N+YNVK8zwyNAbMOeKMqblsEm2YIorgjzQX1m9+/rJeFBKz77PSgeMp/Rc3txFVuSmFmeTy3aMkU= + cvpadmin@hostmachine.local + secondary_ssh_key: ssh-rsa AAAAB3NzaC1yc2EAA82spi2mkxp4FgaLi4CjWkpnL1A/MD7WhrSNgqXToF7QCb9Lidagy9IHafQxfu7LwkFdyQIMu8XNwDZIycuf29wHbDdz1N+YNVK8zwyNAbMOeKMqblsEm2YIorgjzQX1m9+/rJeFBKz77PSgeMp/Rc3txFVuSmFmeTy3aMkz= + cvpadmin@hostmachine.local +management_api_http: + enable_https: true + default_services: false + enable_vrfs: + - name: MGMT +management_interfaces: +- name: Management1 + description: OOB_MANAGEMENT + shutdown: false + vrf: MGMT + ip_address: 192.168.200.129/24 + type: oob + gateway: 192.168.200.5 +metadata: + is_deployed: true + platform: vEOS-LAB + rack: rackE + fabric_name: EOS_DESIGNS_UNIT_TESTS +ntp: + local_interface: + name: Management1 + vrf: MGMT + servers: + - name: 192.168.200.5 + preferred: true + - name: 2001:db8::3 + vrf: MGMT +service_routing_protocols_model: multi-agent +snmp_server: + contact: example@example.com + location: EOS_DESIGNS_UNIT_TESTS rackE dc1-l2leaf8e +spanning_tree: + mode: mstp + mst_instances: + - id: '0' + priority: 16384 +static_routes: +- vrf: MGMT + prefix: 0.0.0.0/0 + next_hop: 192.168.200.5 +transceiver_qsfp_default_mode_4x10: true +vlan_interfaces: +- name: Vlan110 + description: Inband Management + shutdown: false + ip_address: 10.10.10.129/24 + mtu: 1500 + metadata: + type: inband_mgmt +vlan_internal_order: + allocation: ascending + range: + beginning: 1006 + ending: 1199 +vlans: +- id: 110 + name: INBAND_MGMT + metadata: + tenants: + - Tenant_A + - system +- id: 111 + name: Tenant_A_OP_Zone_2 + metadata: + tenants: + - Tenant_A +- id: 112 + name: Tenant_A_OP_Zone_3 + metadata: + tenants: + - Tenant_A +- id: 120 + name: Tenant_A_WEB_Zone_1 + metadata: + tenants: + - Tenant_A +vrfs: +- name: MGMT + ip_routing: false diff --git a/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/structured_configs/dc1-l2leaf8f.yml b/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/structured_configs/dc1-l2leaf8f.yml new file mode 100644 index 00000000000..5824fa55a1e --- /dev/null +++ b/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/structured_configs/dc1-l2leaf8f.yml @@ -0,0 +1,129 @@ +aaa_root: + disabled: true +boot: + secret: + key: a153de6290ff1409257ade45f +config_end: true +daemon_terminattr: + cvaddrs: + - 192.168.200.11:9910 + cvauth: + method: token + token_file: /tmp/token + cvvrf: MGMT + disable_aaa: false + smashexcludes: ale,flexCounter,hardware,kni,pulse,strata +enable_password: + disabled: true +ethernet_interfaces: +- name: Ethernet1 + description: DC1-L2LEAF8A_Ethernet4 + shutdown: false + metadata: + peer: dc1-l2leaf8a + peer_interface: Ethernet4 + peer_type: l2leaf + switchport: + enabled: true + mode: trunk + trunk: + allowed_vlan: '111' +- name: Ethernet2 + description: DC1-L2LEAF8G_Ethernet1 + shutdown: false + metadata: + peer: dc1-l2leaf8g + peer_interface: Ethernet1 + peer_type: l2leaf + switchport: + enabled: true + mode: trunk + trunk: + allowed_vlan: '111' +- name: Ethernet10 + description: Endpoint on ring topology triggering only_vlans_in_use with ring redundancy + shutdown: false + metadata: + peer_type: network_port + peer_key: network_ports + switchport: + enabled: true + mode: access + access_vlan: 111 +hostname: dc1-l2leaf8f +ip_igmp_snooping: + globally_enabled: true +ip_name_server: + vrfs: + - name: MGMT + servers: + - ip_address: 192.168.200.5 + - ip_address: 8.8.8.8 + - ip_address: 2001:db8::1 + - ip_address: 2001:db8::2 +local_users: +- name: admin + disabled: true +- name: cvpadmin + privilege: 15 + role: network-admin + sha512_password: $6$rZKcbIZ7iWGAWTUM$TCgDn1KcavS0s.OV8lacMTUkxTByfzcGlFlYUWroxYuU7M/9bIodhRO7nXGzMweUxvbk8mJmQl8Bh44cRktUj. + ssh_key: ssh-rsa AAAAB3NzaC1yc2EAA82spi2mkxp4FgaLi4CjWkpnL1A/MD7WhrSNgqXToF7QCb9Lidagy9IHafQxfu7LwkFdyQIMu8XNwDZIycuf29wHbDdz1N+YNVK8zwyNAbMOeKMqblsEm2YIorgjzQX1m9+/rJeFBKz77PSgeMp/Rc3txFVuSmFmeTy3aMkU= + cvpadmin@hostmachine.local + secondary_ssh_key: ssh-rsa AAAAB3NzaC1yc2EAA82spi2mkxp4FgaLi4CjWkpnL1A/MD7WhrSNgqXToF7QCb9Lidagy9IHafQxfu7LwkFdyQIMu8XNwDZIycuf29wHbDdz1N+YNVK8zwyNAbMOeKMqblsEm2YIorgjzQX1m9+/rJeFBKz77PSgeMp/Rc3txFVuSmFmeTy3aMkz= + cvpadmin@hostmachine.local +management_api_http: + enable_https: true + default_services: false + enable_vrfs: + - name: MGMT +management_interfaces: +- name: Management1 + description: OOB_MANAGEMENT + shutdown: false + vrf: MGMT + ip_address: 192.168.200.130/24 + type: oob + gateway: 192.168.200.5 +metadata: + is_deployed: true + platform: vEOS-LAB + rack: rackE + fabric_name: EOS_DESIGNS_UNIT_TESTS +ntp: + local_interface: + name: Management1 + vrf: MGMT + servers: + - name: 192.168.200.5 + preferred: true + - name: 2001:db8::3 + vrf: MGMT +service_routing_protocols_model: multi-agent +snmp_server: + contact: example@example.com + location: EOS_DESIGNS_UNIT_TESTS rackE dc1-l2leaf8f +spanning_tree: + mode: mstp + mst_instances: + - id: '0' + priority: 16384 +static_routes: +- vrf: MGMT + prefix: 0.0.0.0/0 + next_hop: 192.168.200.5 +transceiver_qsfp_default_mode_4x10: true +vlan_internal_order: + allocation: ascending + range: + beginning: 1006 + ending: 1199 +vlans: +- id: 111 + name: Tenant_A_OP_Zone_2 + metadata: + tenants: + - Tenant_A +vrfs: +- name: MGMT + ip_routing: false diff --git a/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/structured_configs/dc1-l2leaf8g.yml b/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/structured_configs/dc1-l2leaf8g.yml new file mode 100644 index 00000000000..6e101498cf5 --- /dev/null +++ b/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/structured_configs/dc1-l2leaf8g.yml @@ -0,0 +1,157 @@ +aaa_root: + disabled: true +boot: + secret: + key: a153de6290ff1409257ade45f +config_end: true +daemon_terminattr: + cvaddrs: + - 192.168.200.11:9910 + cvauth: + method: token + token_file: /tmp/token + cvvrf: MGMT + disable_aaa: false + smashexcludes: ale,flexCounter,hardware,kni,pulse,strata +enable_password: + disabled: true +ethernet_interfaces: +- name: Ethernet1 + description: DC1-L2LEAF8F_Ethernet2 + shutdown: false + metadata: + peer: dc1-l2leaf8f + peer_interface: Ethernet2 + peer_type: l2leaf + switchport: + enabled: true + mode: trunk + trunk: + allowed_vlan: '111' +- name: Ethernet2 + description: DC1-L2LEAF8C_Ethernet4 + shutdown: false + metadata: + peer: dc1-l2leaf8c + peer_interface: Ethernet4 + peer_type: l2leaf + switchport: + enabled: true + mode: trunk + trunk: + allowed_vlan: 110-112,120 +- name: Ethernet10 + description: Endpoint on ring topology triggering only_vlans_in_use with ring redundancy + shutdown: false + metadata: + peer_type: network_port + peer_key: network_ports + switchport: + enabled: true + mode: trunk + trunk: + allowed_vlan: 112,120 +hostname: dc1-l2leaf8g +ip_igmp_snooping: + globally_enabled: true + vlans: + - id: 120 + enabled: false +ip_name_server: + vrfs: + - name: MGMT + servers: + - ip_address: 192.168.200.5 + - ip_address: 8.8.8.8 + - ip_address: 2001:db8::1 + - ip_address: 2001:db8::2 +local_users: +- name: admin + disabled: true +- name: cvpadmin + privilege: 15 + role: network-admin + sha512_password: $6$rZKcbIZ7iWGAWTUM$TCgDn1KcavS0s.OV8lacMTUkxTByfzcGlFlYUWroxYuU7M/9bIodhRO7nXGzMweUxvbk8mJmQl8Bh44cRktUj. + ssh_key: ssh-rsa AAAAB3NzaC1yc2EAA82spi2mkxp4FgaLi4CjWkpnL1A/MD7WhrSNgqXToF7QCb9Lidagy9IHafQxfu7LwkFdyQIMu8XNwDZIycuf29wHbDdz1N+YNVK8zwyNAbMOeKMqblsEm2YIorgjzQX1m9+/rJeFBKz77PSgeMp/Rc3txFVuSmFmeTy3aMkU= + cvpadmin@hostmachine.local + secondary_ssh_key: ssh-rsa AAAAB3NzaC1yc2EAA82spi2mkxp4FgaLi4CjWkpnL1A/MD7WhrSNgqXToF7QCb9Lidagy9IHafQxfu7LwkFdyQIMu8XNwDZIycuf29wHbDdz1N+YNVK8zwyNAbMOeKMqblsEm2YIorgjzQX1m9+/rJeFBKz77PSgeMp/Rc3txFVuSmFmeTy3aMkz= + cvpadmin@hostmachine.local +management_api_http: + enable_https: true + default_services: false + enable_vrfs: + - name: MGMT +management_interfaces: +- name: Management1 + description: OOB_MANAGEMENT + shutdown: false + vrf: MGMT + ip_address: 192.168.200.131/24 + type: oob + gateway: 192.168.200.5 +metadata: + is_deployed: true + platform: vEOS-LAB + rack: rackE + fabric_name: EOS_DESIGNS_UNIT_TESTS +ntp: + local_interface: + name: Management1 + vrf: MGMT + servers: + - name: 192.168.200.5 + preferred: true + - name: 2001:db8::3 + vrf: MGMT +service_routing_protocols_model: multi-agent +snmp_server: + contact: example@example.com + location: EOS_DESIGNS_UNIT_TESTS rackE dc1-l2leaf8g +spanning_tree: + mode: mstp + mst_instances: + - id: '0' + priority: 16384 +static_routes: +- vrf: MGMT + prefix: 0.0.0.0/0 + next_hop: 192.168.200.5 +transceiver_qsfp_default_mode_4x10: true +vlan_interfaces: +- name: Vlan110 + description: Inband Management + shutdown: false + ip_address: 10.10.10.131/24 + mtu: 1500 + metadata: + type: inband_mgmt +vlan_internal_order: + allocation: ascending + range: + beginning: 1006 + ending: 1199 +vlans: +- id: 110 + name: INBAND_MGMT + metadata: + tenants: + - Tenant_A + - system +- id: 111 + name: Tenant_A_OP_Zone_2 + metadata: + tenants: + - Tenant_A +- id: 112 + name: Tenant_A_OP_Zone_3 + metadata: + tenants: + - Tenant_A +- id: 120 + name: Tenant_A_WEB_Zone_1 + metadata: + tenants: + - Tenant_A +vrfs: +- name: MGMT + ip_routing: false diff --git a/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/structured_configs/dc1-leaf2a.yml b/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/structured_configs/dc1-leaf2a.yml index 5bc6fe2abbe..068fd3c796f 100644 --- a/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/structured_configs/dc1-leaf2a.yml +++ b/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/structured_configs/dc1-leaf2a.yml @@ -114,6 +114,21 @@ ethernet_interfaces: peer: dc1.l2leaf7a peer_interface: Ethernet1 peer_type: l2leaf +- name: Ethernet33 + description: description through uplink_switch_ethernet_structured_config(dc1-l2leaf8a) + shutdown: false + link_tracking_groups: + - name: l2leaf-server01 + direction: downstream + metadata: + peer: dc1-l2leaf8a + peer_interface: Ethernet1 + peer_type: l2leaf + switchport: + enabled: true + mode: trunk + trunk: + allowed_vlan: 110-112,120-121,130-131,140-141,160-161,210-211,310-311,410-413,450-452 - name: Ethernet49/1 description: P2P_LINK_Ethernet49/1_TO_DC1-SPINE1_Ethernet3/1 shutdown: false diff --git a/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/structured_configs/dc1-leaf2b.yml b/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/structured_configs/dc1-leaf2b.yml index bef88e85cc3..1961d0c4bba 100644 --- a/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/structured_configs/dc1-leaf2b.yml +++ b/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/intended/structured_configs/dc1-leaf2b.yml @@ -104,6 +104,21 @@ ethernet_interfaces: peer: dc1.l2leaf6b peer_interface: Ethernet1 peer_type: l2leaf +- name: Ethernet33 + description: DC1-L2LEAF8C_Ethernet1 + shutdown: false + link_tracking_groups: + - name: LT_GROUP1 + direction: downstream + metadata: + peer: dc1-l2leaf8c + peer_interface: Ethernet1 + peer_type: l2leaf + switchport: + enabled: true + mode: trunk + trunk: + allowed_vlan: 110-112,120-121,130-131,140-141,160-161,210-211,310-311,410-413,450-452 - name: Ethernet49/1 description: P2P_LINK_Ethernet49/1_TO_DC1-SPINE1_Ethernet5/1 shutdown: false diff --git a/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/inventory/group_vars/DC1_FABRIC.yml b/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/inventory/group_vars/DC1_FABRIC.yml index 4d8ebc608f6..f6ff170f8a1 100644 --- a/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/inventory/group_vars/DC1_FABRIC.yml +++ b/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/inventory/group_vars/DC1_FABRIC.yml @@ -444,7 +444,7 @@ l2leaf: uplink_interfaces: [Ethernet1] uplink_switches: [dc1-leaf2b] uplink_switch_interfaces: [Ethernet31] - # Node to test structured configs for underlay_l2 uplinks. + # Node to test structured configs for underlay_l2 uplinks. - group: DC1_L2LEAF7 nodes: - name: dc1.l2leaf7a @@ -460,6 +460,83 @@ l2leaf: uplink_switch_ethernet_structured_config: description: description through uplink_switch_ethernet_structured_config(dc1.l2leaf7a) + # Nodes to test uplink_type: l2-ethernet + # Testing a ring topology with DC-L2LEAF8A-C, a bidirectional child ring with DC-L2LEAF8D-E, + # and a parallel child ring with DC-L2LEAF8F-G where the 8g -> 8f uplink is intentionally omitted. + # + # dc1-leaf2a Et33 <-> Et1 dc1-l2leaf8a Et2 <-> Et1 dc1-l2leaf8b Et2 <-> Et2 dc1-l2leaf8c Et1 <-> Et33 dc1-leaf2b + # | Et3 Et3 | + # | | + # | Et1 dc1-l2leaf8d Et2 <-> Et1 dc1-l2leaf8e Et2 | + # |______________________________________________________| + # + # | Et4 Et4 | + # | | + # | Et1 dc1-l2leaf8f Et2 --> Et1 dc1-l2leaf8g Et2 | + # |______________________________________________________| + - group: DC1_L2LEAF8 + mlag: false + uplink_type: l2-ethernet + nodes: + - name: dc1-l2leaf8a + mgmt_ip: 192.168.200.125/24 + uplink_interfaces: [Ethernet1, Ethernet2] + uplink_switches: [dc1-leaf2a, dc1-l2leaf8b] + uplink_switch_interfaces: [Ethernet33, Ethernet1] + # Structured_config applied to member interfaces of uplink ethernet interface. + uplink_switch_ethernet_structured_config: + description: description through uplink_switch_ethernet_structured_config(dc1-l2leaf8a) + - name: dc1-l2leaf8b + mgmt_ip: 192.168.200.126/24 + uplink_interfaces: [Ethernet1, Ethernet2] + uplink_switches: [dc1-l2leaf8a, dc1-l2leaf8c] + uplink_switch_interfaces: [Ethernet2, Ethernet2] + - name: dc1-l2leaf8c + mgmt_ip: 192.168.200.127/24 + uplink_interfaces: [Ethernet1, Ethernet2] + uplink_switches: [dc1-leaf2b, dc1-l2leaf8b] + uplink_switch_interfaces: [Ethernet33, Ethernet2] + # The next two switches sit on another child ring with stricter VLAN filtering (don't do this at home kids!) + # Also see network_ports in DC1_SERVERS.yml. + - name: dc1-l2leaf8d + mgmt_ip: 192.168.200.128/24 + uplink_interfaces: [Ethernet1, Ethernet2] + uplink_switches: [dc1-l2leaf8a, dc1-l2leaf8e] + uplink_switch_interfaces: [Ethernet3, Ethernet1] + filter: + only_vlans_in_use: true + - name: dc1-l2leaf8e + mgmt_ip: 192.168.200.129/24 + uplink_interfaces: [Ethernet1, Ethernet2] + uplink_switches: [dc1-l2leaf8d, dc1-l2leaf8c] + uplink_switch_interfaces: [Ethernet2, Ethernet3] + inband_mgmt_vlan: 110 # Existing vlan in network services. + inband_mgmt_ip: 10.10.10.129/24 + filter: + only_vlans_in_use: true + # The next two switches sit on a parallel child ring with same vlans as 8d/8e but without bidirection definition of uplinks. + # This should show why bidirectional definitions are required to get consistent vlan lists across the ring. + # Also see network_ports in DC1_SERVERS.yml. + - name: dc1-l2leaf8f + mgmt_ip: 192.168.200.130/24 + uplink_interfaces: [Ethernet1, Ethernet2] + uplink_switches: [dc1-l2leaf8a, dc1-l2leaf8g] + uplink_switch_interfaces: [Ethernet4, Ethernet1] + filter: + only_vlans_in_use: true + - name: dc1-l2leaf8g + mgmt_ip: 192.168.200.131/24 + # Notice that 8g does not declare uplink to 8f, so vlans only used on 8g (110->inband mgmt & 111) + # will not get configured on 8f and not allowed on the trunk between them. + # This is why configuring uplinks in both directions is required for full vlan redundancy. + uplink_interfaces: [Ethernet2] + uplink_switches: [dc1-l2leaf8c] + uplink_switch_interfaces: [Ethernet4] + inband_mgmt_vlan: 110 # Existing vlan in network services. + inband_mgmt_ip: 10.10.10.131/24 + filter: + only_vlans_in_use: true + # Update p2p mtu 9000 -> 1500 p2p_uplinks_mtu: 1500 diff --git a/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/inventory/group_vars/DC1_SERVERS.yml b/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/inventory/group_vars/DC1_SERVERS.yml index 69a12036905..a77b1ebbd75 100644 --- a/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/inventory/group_vars/DC1_SERVERS.yml +++ b/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/inventory/group_vars/DC1_SERVERS.yml @@ -732,3 +732,19 @@ network_ports: - Ethernet24-25 profile: DOT1X_PORT_PROFILE description: PC + - description: Endpoint on ring topology triggering only_vlans_in_use with ring redundancy + switches: + - dc1-l2leaf8d + - dc1-l2leaf8f + switch_ports: + - Ethernet10 + mode: access + vlans: 111 + - description: Endpoint on ring topology triggering only_vlans_in_use with ring redundancy + switches: + - dc1-l2leaf8e + - dc1-l2leaf8g + switch_ports: + - Ethernet10 + mode: trunk + vlans: 112,120 diff --git a/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/inventory/hosts.yml b/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/inventory/hosts.yml index 0edaac6fb60..03096479d73 100644 --- a/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/inventory/hosts.yml +++ b/ansible_collections/arista/avd/extensions/molecule/eos_designs_unit_tests/inventory/hosts.yml @@ -69,6 +69,15 @@ all: hosts: dc1.l2leaf7a: ansible_host: 192.168.200.124 + DC1_L2LEAF8: + hosts: + dc1-l2leaf8a: + dc1-l2leaf8b: + dc1-l2leaf8c: + dc1-l2leaf8d: + dc1-l2leaf8e: + dc1-l2leaf8f: + dc1-l2leaf8g: TESTS: hosts: mgmt-interface-default: diff --git a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/node-type-keys.md b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/node-type-keys.md index 399ef6515c7..97b0a1b188e 100644 --- a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/node-type-keys.md +++ b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/node-type-keys.md @@ -27,7 +27,7 @@ | [      l2](## "custom_node_type_keys.[].network_services.l2") | Boolean | | `False` | | Vlans | | [      l3](## "custom_node_type_keys.[].network_services.l3") | Boolean | | `False` | | VRFs, SVIs (if l2 is true).
Only supported with underlay_router.
| | [    underlay_router](## "custom_node_type_keys.[].underlay_router") | Boolean | | `True` | | Is this node type a L3 device. | - | [    uplink_type](## "custom_node_type_keys.[].uplink_type") | String | | `p2p` | Valid Values:
- p2p
- port-channel
- p2p-vrfs
- lan | `uplink_type` must be `p2p`, `p2p-vrfs` or `lan` if `vtep` or `underlay_router` is true.

For `p2p-vrfs`, the uplinks are configured as L3 interfaces with a subinterface for each VRF
in `network_services` present on both the uplink and the downlink switch.
The subinterface ID is the `vrf_id`.
'underlay_router' and 'network_services.l3' must be set to true.
VRF `default` is always configured on the physical interface using the underlay routing protocol.
All subinterfaces use the same IP address as the physical interface.
Multicast is not supported.
Only BGP is supported for subinterfaces.

For `lan`, a single uplink interface is supported and will be configured as an L3 Interface with
subinterfaces for each SVI defined under the VRFs in `network_services` as long as the uplink switch also
has the VLAN permitted by tag/tenant filtering. | + | [    uplink_type](## "custom_node_type_keys.[].uplink_type") | String | | `p2p` | Valid Values:
- p2p
- port-channel
- p2p-vrfs
- lan
- l2-ethernet | `uplink_type` must be `p2p`, `p2p-vrfs` or `lan` if `vtep` or `underlay_router` is true.

For `p2p-vrfs`, the uplinks are configured as L3 interfaces with a subinterface for each VRF
in `network_services` present on both the uplink and the downlink switch.
The subinterface ID is the `vrf_id`.
'underlay_router' and 'network_services.l3' must be set to true.
VRF `default` is always configured on the physical interface using the underlay routing protocol.
All subinterfaces use the same IP address as the physical interface.
Multicast is not supported.
Only BGP is supported for subinterfaces.

For `lan`, a single uplink interface is supported and will be configured as an L3 Interface with
subinterfaces for each SVI defined under the VRFs in `network_services` as long as the uplink switch also
has the VLAN permitted by tag/tenant filtering.

`port-channel` and `l2-ethernet` options configures L2 trunks carrying all active VLANs permitted by tag/tenant filtering.
Redundant L2 ring VLAN propagation is only calculated for links towards `uplink_switches`.
For ring redundancy, define the ring links on both participating switches. | | [    vtep](## "custom_node_type_keys.[].vtep") | Boolean | | `False` | | Is this switch an EVPN VTEP. | | [    mpls_lsr](## "custom_node_type_keys.[].mpls_lsr") | Boolean | | `False` | | Is this switch an MPLS LSR. | | [    ip_addressing](## "custom_node_type_keys.[].ip_addressing") | Dictionary | | | | Override ip_addressing templates. | @@ -77,7 +77,7 @@ | [      l2](## "node_type_keys.[].network_services.l2") | Boolean | | `False` | | Vlans | | [      l3](## "node_type_keys.[].network_services.l3") | Boolean | | `False` | | VRFs, SVIs (if l2 is true).
Only supported with underlay_router.
| | [    underlay_router](## "node_type_keys.[].underlay_router") | Boolean | | `True` | | Is this node type a L3 device. | - | [    uplink_type](## "node_type_keys.[].uplink_type") | String | | `p2p` | Valid Values:
- p2p
- port-channel
- p2p-vrfs
- lan | `uplink_type` must be `p2p`, `p2p-vrfs` or `lan` if `vtep` or `underlay_router` is true.

For `p2p-vrfs`, the uplinks are configured as L3 interfaces with a subinterface for each VRF
in `network_services` present on both the uplink and the downlink switch.
The subinterface ID is the `vrf_id`.
'underlay_router' and 'network_services.l3' must be set to true.
VRF `default` is always configured on the physical interface using the underlay routing protocol.
All subinterfaces use the same IP address as the physical interface.
Multicast is not supported.
Only BGP is supported for subinterfaces.

For `lan`, a single uplink interface is supported and will be configured as an L3 Interface with
subinterfaces for each SVI defined under the VRFs in `network_services` as long as the uplink switch also
has the VLAN permitted by tag/tenant filtering. | + | [    uplink_type](## "node_type_keys.[].uplink_type") | String | | `p2p` | Valid Values:
- p2p
- port-channel
- p2p-vrfs
- lan
- l2-ethernet | `uplink_type` must be `p2p`, `p2p-vrfs` or `lan` if `vtep` or `underlay_router` is true.

For `p2p-vrfs`, the uplinks are configured as L3 interfaces with a subinterface for each VRF
in `network_services` present on both the uplink and the downlink switch.
The subinterface ID is the `vrf_id`.
'underlay_router' and 'network_services.l3' must be set to true.
VRF `default` is always configured on the physical interface using the underlay routing protocol.
All subinterfaces use the same IP address as the physical interface.
Multicast is not supported.
Only BGP is supported for subinterfaces.

For `lan`, a single uplink interface is supported and will be configured as an L3 Interface with
subinterfaces for each SVI defined under the VRFs in `network_services` as long as the uplink switch also
has the VLAN permitted by tag/tenant filtering.

`port-channel` and `l2-ethernet` options configures L2 trunks carrying all active VLANs permitted by tag/tenant filtering.
Redundant L2 ring VLAN propagation is only calculated for links towards `uplink_switches`.
For ring redundancy, define the ring links on both participating switches. | | [    vtep](## "node_type_keys.[].vtep") | Boolean | | `False` | | Is this switch an EVPN VTEP. | | [    mpls_lsr](## "node_type_keys.[].mpls_lsr") | Boolean | | `False` | | Is this switch an MPLS LSR. | | [    ip_addressing](## "node_type_keys.[].ip_addressing") | Dictionary | | | | Override ip_addressing templates. | @@ -193,7 +193,11 @@ # For `lan`, a single uplink interface is supported and will be configured as an L3 Interface with # subinterfaces for each SVI defined under the VRFs in `network_services` as long as the uplink switch also # has the VLAN permitted by tag/tenant filtering. - uplink_type: + # + # `port-channel` and `l2-ethernet` options configures L2 trunks carrying all active VLANs permitted by tag/tenant filtering. + # Redundant L2 ring VLAN propagation is only calculated for links towards `uplink_switches`. + # For ring redundancy, define the ring links on both participating switches. + uplink_type: # Is this switch an EVPN VTEP. vtep: @@ -365,7 +369,11 @@ # For `lan`, a single uplink interface is supported and will be configured as an L3 Interface with # subinterfaces for each SVI defined under the VRFs in `network_services` as long as the uplink switch also # has the VLAN permitted by tag/tenant filtering. - uplink_type: + # + # `port-channel` and `l2-ethernet` options configures L2 trunks carrying all active VLANs permitted by tag/tenant filtering. + # Redundant L2 ring VLAN propagation is only calculated for links towards `uplink_switches`. + # For ring redundancy, define the ring links on both participating switches. + uplink_type: # Is this switch an EVPN VTEP. vtep: diff --git a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/node-type-uplink-configuration.md b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/node-type-uplink-configuration.md index f9a3960c45a..917c1b99ed3 100644 --- a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/node-type-uplink-configuration.md +++ b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/node-type-uplink-configuration.md @@ -18,7 +18,7 @@ | [        - name](## ".defaults.link_tracking.groups.[].name") | String | Required, Unique | | | Tracking group name. | | [          recovery_delay](## ".defaults.link_tracking.groups.[].recovery_delay") | Integer | | | Min: 0
Max: 3600 | default -> platform_settings_mlag_reload_delay -> 300. | | [          links_minimum](## ".defaults.link_tracking.groups.[].links_minimum") | Integer | | | Min: 1
Max: 100000 | | - | [    uplink_type](## ".defaults.uplink_type") | String | | | Valid Values:
- p2p
- port-channel
- p2p-vrfs
- lan | Override the default `uplink_type` set at the `node_type_key` level.
`uplink_type` must be "p2p" if `vtep` or `underlay_router` is true for the `node_type_key` definition. | + | [    uplink_type](## ".defaults.uplink_type") | String | | | Valid Values:
- p2p
- port-channel
- p2p-vrfs
- lan
- l2-ethernet | Override the default `uplink_type` set at the `node_type_key` level.
`uplink_type` must be "p2p" if `vtep` or `underlay_router` is true for the `node_type_key` definition. | | [    uplink_ipv4_pool](## ".defaults.uplink_ipv4_pool") | String | | | Format: ipv4_pool | Comma separated list of prefixes (IPv4 address/Mask) or ranges (IPv4_address-IPv4_address).
IPv4 subnets used to connect to uplink switches will be deviced from this pool based on the node id,
uplink interface index, 'max_uplink_switches' and 'max_parallel_uplinks'. | | [    uplink_ipv6_pool](## ".defaults.uplink_ipv6_pool") | String | | | Format: ipv6_pool | Comma separated list of prefixes (IPv6 address/Mask) or ranges (IPv6_address-IPv6_address).
IPv6 subnets used to connect to uplink switches will be deviced from this pool based on the node id,
uplink interface index, 'max_uplink_switches' and 'max_parallel_uplinks'. | | [    uplink_interfaces](## ".defaults.uplink_interfaces") | List, items: String | | | | Local uplink interfaces.
Each list item supports range syntax that can be expanded into a list of interfaces.
If uplink_interfaces is not defined, platform-specific defaults (defined under default_interfaces) will be used instead.
Please note that default_interfaces are not defined by default, you should define these yourself.
| @@ -64,7 +64,7 @@ | [              - name](## ".node_groups.[].nodes.[].link_tracking.groups.[].name") | String | Required, Unique | | | Tracking group name. | | [                recovery_delay](## ".node_groups.[].nodes.[].link_tracking.groups.[].recovery_delay") | Integer | | | Min: 0
Max: 3600 | default -> platform_settings_mlag_reload_delay -> 300. | | [                links_minimum](## ".node_groups.[].nodes.[].link_tracking.groups.[].links_minimum") | Integer | | | Min: 1
Max: 100000 | | - | [          uplink_type](## ".node_groups.[].nodes.[].uplink_type") | String | | | Valid Values:
- p2p
- port-channel
- p2p-vrfs
- lan | Override the default `uplink_type` set at the `node_type_key` level.
`uplink_type` must be "p2p" if `vtep` or `underlay_router` is true for the `node_type_key` definition. | + | [          uplink_type](## ".node_groups.[].nodes.[].uplink_type") | String | | | Valid Values:
- p2p
- port-channel
- p2p-vrfs
- lan
- l2-ethernet | Override the default `uplink_type` set at the `node_type_key` level.
`uplink_type` must be "p2p" if `vtep` or `underlay_router` is true for the `node_type_key` definition. | | [          uplink_ipv4_pool](## ".node_groups.[].nodes.[].uplink_ipv4_pool") | String | | | Format: ipv4_pool | Comma separated list of prefixes (IPv4 address/Mask) or ranges (IPv4_address-IPv4_address).
IPv4 subnets used to connect to uplink switches will be deviced from this pool based on the node id,
uplink interface index, 'max_uplink_switches' and 'max_parallel_uplinks'. | | [          uplink_ipv6_pool](## ".node_groups.[].nodes.[].uplink_ipv6_pool") | String | | | Format: ipv6_pool | Comma separated list of prefixes (IPv6 address/Mask) or ranges (IPv6_address-IPv6_address).
IPv6 subnets used to connect to uplink switches will be deviced from this pool based on the node id,
uplink interface index, 'max_uplink_switches' and 'max_parallel_uplinks'. | | [          uplink_interfaces](## ".node_groups.[].nodes.[].uplink_interfaces") | List, items: String | | | | Local uplink interfaces.
Each list item supports range syntax that can be expanded into a list of interfaces.
If uplink_interfaces is not defined, platform-specific defaults (defined under default_interfaces) will be used instead.
Please note that default_interfaces are not defined by default, you should define these yourself.
| @@ -101,7 +101,7 @@ | [          - name](## ".node_groups.[].link_tracking.groups.[].name") | String | Required, Unique | | | Tracking group name. | | [            recovery_delay](## ".node_groups.[].link_tracking.groups.[].recovery_delay") | Integer | | | Min: 0
Max: 3600 | default -> platform_settings_mlag_reload_delay -> 300. | | [            links_minimum](## ".node_groups.[].link_tracking.groups.[].links_minimum") | Integer | | | Min: 1
Max: 100000 | | - | [      uplink_type](## ".node_groups.[].uplink_type") | String | | | Valid Values:
- p2p
- port-channel
- p2p-vrfs
- lan | Override the default `uplink_type` set at the `node_type_key` level.
`uplink_type` must be "p2p" if `vtep` or `underlay_router` is true for the `node_type_key` definition. | + | [      uplink_type](## ".node_groups.[].uplink_type") | String | | | Valid Values:
- p2p
- port-channel
- p2p-vrfs
- lan
- l2-ethernet | Override the default `uplink_type` set at the `node_type_key` level.
`uplink_type` must be "p2p" if `vtep` or `underlay_router` is true for the `node_type_key` definition. | | [      uplink_ipv4_pool](## ".node_groups.[].uplink_ipv4_pool") | String | | | Format: ipv4_pool | Comma separated list of prefixes (IPv4 address/Mask) or ranges (IPv4_address-IPv4_address).
IPv4 subnets used to connect to uplink switches will be deviced from this pool based on the node id,
uplink interface index, 'max_uplink_switches' and 'max_parallel_uplinks'. | | [      uplink_ipv6_pool](## ".node_groups.[].uplink_ipv6_pool") | String | | | Format: ipv6_pool | Comma separated list of prefixes (IPv6 address/Mask) or ranges (IPv6_address-IPv6_address).
IPv6 subnets used to connect to uplink switches will be deviced from this pool based on the node id,
uplink interface index, 'max_uplink_switches' and 'max_parallel_uplinks'. | | [      uplink_interfaces](## ".node_groups.[].uplink_interfaces") | List, items: String | | | | Local uplink interfaces.
Each list item supports range syntax that can be expanded into a list of interfaces.
If uplink_interfaces is not defined, platform-specific defaults (defined under default_interfaces) will be used instead.
Please note that default_interfaces are not defined by default, you should define these yourself.
| @@ -145,7 +145,7 @@ | [          - name](## ".nodes.[].link_tracking.groups.[].name") | String | Required, Unique | | | Tracking group name. | | [            recovery_delay](## ".nodes.[].link_tracking.groups.[].recovery_delay") | Integer | | | Min: 0
Max: 3600 | default -> platform_settings_mlag_reload_delay -> 300. | | [            links_minimum](## ".nodes.[].link_tracking.groups.[].links_minimum") | Integer | | | Min: 1
Max: 100000 | | - | [      uplink_type](## ".nodes.[].uplink_type") | String | | | Valid Values:
- p2p
- port-channel
- p2p-vrfs
- lan | Override the default `uplink_type` set at the `node_type_key` level.
`uplink_type` must be "p2p" if `vtep` or `underlay_router` is true for the `node_type_key` definition. | + | [      uplink_type](## ".nodes.[].uplink_type") | String | | | Valid Values:
- p2p
- port-channel
- p2p-vrfs
- lan
- l2-ethernet | Override the default `uplink_type` set at the `node_type_key` level.
`uplink_type` must be "p2p" if `vtep` or `underlay_router` is true for the `node_type_key` definition. | | [      uplink_ipv4_pool](## ".nodes.[].uplink_ipv4_pool") | String | | | Format: ipv4_pool | Comma separated list of prefixes (IPv4 address/Mask) or ranges (IPv4_address-IPv4_address).
IPv4 subnets used to connect to uplink switches will be deviced from this pool based on the node id,
uplink interface index, 'max_uplink_switches' and 'max_parallel_uplinks'. | | [      uplink_ipv6_pool](## ".nodes.[].uplink_ipv6_pool") | String | | | Format: ipv6_pool | Comma separated list of prefixes (IPv6 address/Mask) or ranges (IPv6_address-IPv6_address).
IPv6 subnets used to connect to uplink switches will be deviced from this pool based on the node id,
uplink interface index, 'max_uplink_switches' and 'max_parallel_uplinks'. | | [      uplink_interfaces](## ".nodes.[].uplink_interfaces") | List, items: String | | | | Local uplink interfaces.
Each list item supports range syntax that can be expanded into a list of interfaces.
If uplink_interfaces is not defined, platform-specific defaults (defined under default_interfaces) will be used instead.
Please note that default_interfaces are not defined by default, you should define these yourself.
| @@ -184,7 +184,7 @@ | [        - name](## "device_profiles.[].link_tracking.groups.[].name") | String | Required, Unique | | | Tracking group name. | | [          recovery_delay](## "device_profiles.[].link_tracking.groups.[].recovery_delay") | Integer | | | Min: 0
Max: 3600 | default -> platform_settings_mlag_reload_delay -> 300. | | [          links_minimum](## "device_profiles.[].link_tracking.groups.[].links_minimum") | Integer | | | Min: 1
Max: 100000 | | - | [    uplink_type](## "device_profiles.[].uplink_type") | String | | | Valid Values:
- p2p
- port-channel
- p2p-vrfs
- lan | Override the default `uplink_type` set at the `node_type_key` level.
`uplink_type` must be "p2p" if `vtep` or `underlay_router` is true for the `node_type_key` definition. | + | [    uplink_type](## "device_profiles.[].uplink_type") | String | | | Valid Values:
- p2p
- port-channel
- p2p-vrfs
- lan
- l2-ethernet | Override the default `uplink_type` set at the `node_type_key` level.
`uplink_type` must be "p2p" if `vtep` or `underlay_router` is true for the `node_type_key` definition. | | [    uplink_ipv4_pool](## "device_profiles.[].uplink_ipv4_pool") | String | | | Format: ipv4_pool | Comma separated list of prefixes (IPv4 address/Mask) or ranges (IPv4_address-IPv4_address).
IPv4 subnets used to connect to uplink switches will be deviced from this pool based on the node id,
uplink interface index, 'max_uplink_switches' and 'max_parallel_uplinks'. | | [    uplink_ipv6_pool](## "device_profiles.[].uplink_ipv6_pool") | String | | | Format: ipv6_pool | Comma separated list of prefixes (IPv6 address/Mask) or ranges (IPv6_address-IPv6_address).
IPv6 subnets used to connect to uplink switches will be deviced from this pool based on the node id,
uplink interface index, 'max_uplink_switches' and 'max_parallel_uplinks'. | | [    uplink_interfaces](## "device_profiles.[].uplink_interfaces") | List, items: String | | | | Local uplink interfaces.
Each list item supports range syntax that can be expanded into a list of interfaces.
If uplink_interfaces is not defined, platform-specific defaults (defined under default_interfaces) will be used instead.
Please note that default_interfaces are not defined by default, you should define these yourself.
| @@ -228,7 +228,7 @@ | [        - name](## "devices.[].link_tracking.groups.[].name") | String | Required, Unique | | | Tracking group name. | | [          recovery_delay](## "devices.[].link_tracking.groups.[].recovery_delay") | Integer | | | Min: 0
Max: 3600 | default -> platform_settings_mlag_reload_delay -> 300. | | [          links_minimum](## "devices.[].link_tracking.groups.[].links_minimum") | Integer | | | Min: 1
Max: 100000 | | - | [    uplink_type](## "devices.[].uplink_type") | String | | | Valid Values:
- p2p
- port-channel
- p2p-vrfs
- lan | Override the default `uplink_type` set at the `node_type_key` level.
`uplink_type` must be "p2p" if `vtep` or `underlay_router` is true for the `node_type_key` definition. | + | [    uplink_type](## "devices.[].uplink_type") | String | | | Valid Values:
- p2p
- port-channel
- p2p-vrfs
- lan
- l2-ethernet | Override the default `uplink_type` set at the `node_type_key` level.
`uplink_type` must be "p2p" if `vtep` or `underlay_router` is true for the `node_type_key` definition. | | [    uplink_ipv4_pool](## "devices.[].uplink_ipv4_pool") | String | | | Format: ipv4_pool | Comma separated list of prefixes (IPv4 address/Mask) or ranges (IPv4_address-IPv4_address).
IPv4 subnets used to connect to uplink switches will be deviced from this pool based on the node id,
uplink interface index, 'max_uplink_switches' and 'max_parallel_uplinks'. | | [    uplink_ipv6_pool](## "devices.[].uplink_ipv6_pool") | String | | | Format: ipv6_pool | Comma separated list of prefixes (IPv6 address/Mask) or ranges (IPv6_address-IPv6_address).
IPv6 subnets used to connect to uplink switches will be deviced from this pool based on the node id,
uplink interface index, 'max_uplink_switches' and 'max_parallel_uplinks'. | | [    uplink_interfaces](## "devices.[].uplink_interfaces") | List, items: String | | | | Local uplink interfaces.
Each list item supports range syntax that can be expanded into a list of interfaces.
If uplink_interfaces is not defined, platform-specific defaults (defined under default_interfaces) will be used instead.
Please note that default_interfaces are not defined by default, you should define these yourself.
| @@ -294,7 +294,7 @@ # Override the default `uplink_type` set at the `node_type_key` level. # `uplink_type` must be "p2p" if `vtep` or `underlay_router` is true for the `node_type_key` definition. - uplink_type: + uplink_type: # Comma separated list of prefixes (IPv4 address/Mask) or ranges (IPv4_address-IPv4_address). # IPv4 subnets used to connect to uplink switches will be deviced from this pool based on the node id, @@ -456,7 +456,7 @@ # Override the default `uplink_type` set at the `node_type_key` level. # `uplink_type` must be "p2p" if `vtep` or `underlay_router` is true for the `node_type_key` definition. - uplink_type: + uplink_type: # Comma separated list of prefixes (IPv4 address/Mask) or ranges (IPv4_address-IPv4_address). # IPv4 subnets used to connect to uplink switches will be deviced from this pool based on the node id, @@ -590,7 +590,7 @@ # Override the default `uplink_type` set at the `node_type_key` level. # `uplink_type` must be "p2p" if `vtep` or `underlay_router` is true for the `node_type_key` definition. - uplink_type: + uplink_type: # Comma separated list of prefixes (IPv4 address/Mask) or ranges (IPv4_address-IPv4_address). # IPv4 subnets used to connect to uplink switches will be deviced from this pool based on the node id, @@ -745,7 +745,7 @@ # Override the default `uplink_type` set at the `node_type_key` level. # `uplink_type` must be "p2p" if `vtep` or `underlay_router` is true for the `node_type_key` definition. - uplink_type: + uplink_type: # Comma separated list of prefixes (IPv4 address/Mask) or ranges (IPv4_address-IPv4_address). # IPv4 subnets used to connect to uplink switches will be deviced from this pool based on the node id, @@ -885,7 +885,7 @@ # Override the default `uplink_type` set at the `node_type_key` level. # `uplink_type` must be "p2p" if `vtep` or `underlay_router` is true for the `node_type_key` definition. - uplink_type: + uplink_type: # Comma separated list of prefixes (IPv4 address/Mask) or ranges (IPv4_address-IPv4_address). # IPv4 subnets used to connect to uplink switches will be deviced from this pool based on the node id, @@ -1040,7 +1040,7 @@ # Override the default `uplink_type` set at the `node_type_key` level. # `uplink_type` must be "p2p" if `vtep` or `underlay_router` is true for the `node_type_key` definition. - uplink_type: + uplink_type: # Comma separated list of prefixes (IPv4 address/Mask) or ranges (IPv4_address-IPv4_address). # IPv4 subnets used to connect to uplink switches will be deviced from this pool based on the node id, diff --git a/docs/contribution/eos_designs_facts_internal/tables/eos_designs_facts.md b/docs/contribution/eos_designs_facts_internal/tables/eos_designs_facts.md index 92eab18f83f..87eafda531b 100644 --- a/docs/contribution/eos_designs_facts_internal/tables/eos_designs_facts.md +++ b/docs/contribution/eos_designs_facts_internal/tables/eos_designs_facts.md @@ -140,7 +140,7 @@ | [  - <str>](## "uplink_peers.[]") | String | | | | | | [uplink_switch_vrfs](## "uplink_switch_vrfs") | List, items: String | | | | | | [  - <str>](## "uplink_switch_vrfs.[]") | String | | | | | - | [vlans](## "vlans") | String | Required | | | Compressed list of vlans to be defined on this switch after filtering network services.
The filter is based on filter.tenants, filter.tags but not filter.only_vlans_in_use.

Ex. "1-100, 201-202"

This excludes the optional "uplink_native_vlan" if that vlan is not used for anything else.
This is to ensure that native vlan is not necessarily permitted on the uplink trunk. | + | [vlans](## "vlans") | String | Required | | | Compressed list of VLANs to be defined on this switch.
These are the available VLANs after local network-service filtering and VLAN availability filtering from uplink switches.

Ex. "1-100, 201-202"

This excludes the optional "uplink_native_vlan" if that vlan is not used for anything else.
This is to ensure that native vlan is not necessarily permitted on the uplink trunk. | | [endpoint_vlans](## "endpoint_vlans") | String | | | | Compressed list of vlans in use by endpoints connected to this switch, downstream switches or MLAG peer and its downstream switches. | | [local_endpoint_trunk_groups](## "local_endpoint_trunk_groups") | List, items: String | | | | List of trunk_groups in use by endpoints connected to this switch. | | [  - <str>](## "local_endpoint_trunk_groups.[]") | String | | | | | @@ -377,8 +377,8 @@ uplink_switch_vrfs: - - # Compressed list of vlans to be defined on this switch after filtering network services. - # The filter is based on filter.tenants, filter.tags but not filter.only_vlans_in_use. + # Compressed list of VLANs to be defined on this switch. + # These are the available VLANs after local network-service filtering and VLAN availability filtering from uplink switches. # # Ex. "1-100, 201-202" # diff --git a/python-avd/pyavd/_eos_designs/eos_designs_facts/schema/eos_designs_facts.schema.yml b/python-avd/pyavd/_eos_designs/eos_designs_facts/schema/eos_designs_facts.schema.yml index 4ead58876ef..38ae0be32bf 100644 --- a/python-avd/pyavd/_eos_designs/eos_designs_facts/schema/eos_designs_facts.schema.yml +++ b/python-avd/pyavd/_eos_designs/eos_designs_facts/schema/eos_designs_facts.schema.yml @@ -366,8 +366,8 @@ keys: type: str required: true description: |- - Compressed list of vlans to be defined on this switch after filtering network services. - The filter is based on filter.tenants, filter.tags but not filter.only_vlans_in_use. + Compressed list of VLANs to be defined on this switch. + These are the available VLANs after local network-service filtering and VLAN availability filtering from uplink switches. Ex. "1-100, 201-202" diff --git a/python-avd/pyavd/_eos_designs/eos_designs_facts/schema/protocol.py b/python-avd/pyavd/_eos_designs/eos_designs_facts/schema/protocol.py index 94198f7d9b4..dff3cdbbe1e 100644 --- a/python-avd/pyavd/_eos_designs/eos_designs_facts/schema/protocol.py +++ b/python-avd/pyavd/_eos_designs/eos_designs_facts/schema/protocol.py @@ -1281,14 +1281,16 @@ class MplsRouteReflectorClients(AvdList[str]): """Subclass of AvdList with `str` items.""" vlans: str """ - Compressed list of vlans to be defined on this switch after filtering network services. - The filter - is based on filter.tenants, filter.tags but not filter.only_vlans_in_use. - - Ex. "1-100, 201-202" - This excludes the optional "uplink_native_vlan" if that vlan is not used for anything else. - This is - to ensure that native vlan is not necessarily permitted on the uplink trunk. + Compressed list of VLANs to be defined on this switch. + These are the available VLANs after local + network-service filtering and VLAN availability filtering from uplink switches. + + Ex. "1-100, + 201-202" + + This excludes the optional "uplink_native_vlan" if that vlan is not used for anything + else. + This is to ensure that native vlan is not necessarily permitted on the uplink trunk. """ endpoint_vlans: str | None """ @@ -1490,14 +1492,16 @@ def __init__( uplink_peers: Subclass of AvdList with `str` items. uplink_switch_vrfs: Subclass of AvdList with `str` items. vlans: - Compressed list of vlans to be defined on this switch after filtering network services. - The filter - is based on filter.tenants, filter.tags but not filter.only_vlans_in_use. - - Ex. "1-100, 201-202" - This excludes the optional "uplink_native_vlan" if that vlan is not used for anything else. - This is - to ensure that native vlan is not necessarily permitted on the uplink trunk. + Compressed list of VLANs to be defined on this switch. + These are the available VLANs after local + network-service filtering and VLAN availability filtering from uplink switches. + + Ex. "1-100, + 201-202" + + This excludes the optional "uplink_native_vlan" if that vlan is not used for anything + else. + This is to ensure that native vlan is not necessarily permitted on the uplink trunk. endpoint_vlans: Compressed list of vlans in use by endpoints connected to this switch, downstream switches or MLAG peer and its downstream switches. diff --git a/python-avd/pyavd/_eos_designs/eos_designs_facts/uplinks.py b/python-avd/pyavd/_eos_designs/eos_designs_facts/uplinks.py index e72057d7049..8f79e7c0b7d 100644 --- a/python-avd/pyavd/_eos_designs/eos_designs_facts/uplinks.py +++ b/python-avd/pyavd/_eos_designs/eos_designs_facts/uplinks.py @@ -10,7 +10,7 @@ from pyavd._eos_designs.eos_designs_facts.schema import EosDesignsFactsProtocol from pyavd._errors import AristaAvdError, AristaAvdInvalidInputsError from pyavd._utils import remove_cached_property_type -from pyavd.j2filters import list_compress, natural_sort, range_expand +from pyavd.j2filters import natural_sort, range_expand if TYPE_CHECKING: from . import EosDesignsFactsGeneratorProtocol @@ -125,30 +125,36 @@ def uplinks(self: EosDesignsFactsGeneratorProtocol) -> EosDesignsFactsProtocol.U These facts are leveraged by templates for this device when rendering uplinks and by templates for peer devices when rendering downlinks """ - if self.shared_utils.uplink_type == "port-channel": - if self.inputs.avd_design_future.raise_for_underlay_router_with_uplink_type_port_channel and self.shared_utils.underlay_router is True: - msg = "'underlay_router: true' is not supported with 'uplink_type: port-channel'." - raise AristaAvdInvalidInputsError(msg) - get_uplink = self._get_port_channel_uplink - elif self.shared_utils.uplink_type == "p2p-vrfs": - if self.shared_utils.network_services_l3 is False or self.shared_utils.underlay_router is False: - msg = "'underlay_router' and 'network_services.l3' must be 'true' for the node_type_key when using 'p2p-vrfs' as 'uplink_type'." - raise AristaAvdError(msg) - get_uplink = self._get_p2p_vrfs_uplink - elif self.shared_utils.uplink_type == "lan": - if self.shared_utils.network_services_l3 is False or self.shared_utils.underlay_router is False: - msg = "'underlay_router' and 'network_services.l3' must be 'true' for the node_type_key when using 'lan' as 'uplink_type'." - raise AristaAvdError(msg) - if len(self.shared_utils.uplink_interfaces) > 1: - msg = f"'uplink_type: lan' only supports a single uplink interface. Got {self.shared_utils.uplink_interfaces}." - raise AristaAvdError(msg) - # TODO: Adjust error message when we add lan-port-channel support. - # uplink_type: lan' only supports a single uplink interface. - # Got {self._uplink_interfaces}. Consider 'uplink_type: lan-port-channel' if applicable. - get_uplink = self._get_l2_uplink - else: - # Uplink type is 'p2p'. - get_uplink = self._get_p2p_uplink + match self.shared_utils.uplink_type: + case "port-channel": + if self.inputs.avd_design_future.raise_for_underlay_router_with_uplink_type_port_channel and self.shared_utils.underlay_router is True: + msg = "'underlay_router: true' is not supported with 'uplink_type: port-channel'." + raise AristaAvdInvalidInputsError(msg) + get_uplink = self._get_port_channel_uplink + case "l2-ethernet": + if self.shared_utils.underlay_router is True: + msg = "'underlay_router: true' is not supported with 'uplink_type: l2-ethernet'." + raise AristaAvdInvalidInputsError(msg) + get_uplink = self._get_l2_uplink + case "p2p-vrfs": + if self.shared_utils.network_services_l3 is False or self.shared_utils.underlay_router is False: + msg = "'underlay_router' and 'network_services.l3' must be 'true' for the node_type_key when using 'p2p-vrfs' as 'uplink_type'." + raise AristaAvdError(msg) + get_uplink = self._get_p2p_vrfs_uplink + case "lan": + if self.shared_utils.network_services_l3 is False or self.shared_utils.underlay_router is False: + msg = "'underlay_router' and 'network_services.l3' must be 'true' for the node_type_key when using 'lan' as 'uplink_type'." + raise AristaAvdError(msg) + if len(self.shared_utils.uplink_interfaces) > 1: + msg = f"'uplink_type: lan' only supports a single uplink interface. Got {self.shared_utils.uplink_interfaces}." + raise AristaAvdError(msg) + # TODO: Adjust error message when we add lan-port-channel support. + # uplink_type: lan' only supports a single uplink interface. + # Got {self._uplink_interfaces}. Consider 'uplink_type: lan-port-channel' if applicable. + get_uplink = self._get_l2_uplink + case _: + # Uplink type is 'p2p'. + get_uplink = self._get_p2p_uplink uplinks = EosDesignsFactsProtocol.Uplinks() uplink_switches = self.shared_utils.uplink_switches @@ -273,7 +279,11 @@ def _get_l2_uplink( uplink_switch: str, uplink_switch_interface: str, ) -> EosDesignsFactsProtocol.UplinksItem: - """Return a single uplink dictionary for an L2 uplink. Reused for both uplink_type port-channel, lan and TODO: lan-port-channel.""" + """ + Return a single uplink dictionary for an L2 uplink. + + Used for both uplink_type port-channel, l2-ethernet, lan and TODO: lan-port-channel. + """ uplink_switch_facts = self.get_peer_facts_generator(uplink_switch) uplink = EosDesignsFactsProtocol.UplinksItem( interface=uplink_interface, @@ -295,7 +305,6 @@ def _get_l2_uplink( elif self.shared_utils.ptp_enabled: uplink.ptp.enable = True - # Remove vlans if upstream switch does not have them #} if self.inputs.enable_trunk_groups: uplink.trunk_groups.append_unique("UPLINK") if self.shared_utils.mlag is True and self.shared_utils.group: @@ -303,14 +312,7 @@ def _get_l2_uplink( else: uplink.peer_trunk_groups.append_unique(self.shared_utils.hostname) - uplink_vlans = set(self._vlans) - uplink_vlans = uplink_vlans.intersection(uplink_switch_facts._vlans) - - if self.shared_utils.configure_inband_mgmt or self.shared_utils.configure_inband_mgmt_ipv6: - # Always add inband_mgmt_vlan even if the uplink switch does not have this vlan defined - uplink_vlans.add(self.shared_utils.node_config.inband_mgmt_vlan) - - uplink.vlans = list_compress(list(uplink_vlans)) if uplink_vlans else "none" + uplink.vlans = self.vlans or "none" if uplink_native_vlan := self.shared_utils.node_config.uplink_native_vlan: uplink.native_vlan = uplink_native_vlan diff --git a/python-avd/pyavd/_eos_designs/eos_designs_facts/vlans.py b/python-avd/pyavd/_eos_designs/eos_designs_facts/vlans.py index e2d83480d82..9944e221765 100644 --- a/python-avd/pyavd/_eos_designs/eos_designs_facts/vlans.py +++ b/python-avd/pyavd/_eos_designs/eos_designs_facts/vlans.py @@ -5,10 +5,11 @@ import re from functools import cached_property +from itertools import chain from typing import TYPE_CHECKING, Protocol from pyavd._eos_designs.eos_designs_facts.schema import EosDesignsFactsProtocol -from pyavd._utils import remove_cached_property_type +from pyavd._utils import remove_cached_property_type, unique from pyavd.j2filters import list_compress, natural_sort, range_expand if TYPE_CHECKING: @@ -29,16 +30,19 @@ class VlansMixin(EosDesignsFactsProtocol, Protocol): @cached_property def vlans(self: EosDesignsFactsGeneratorProtocol) -> str: """ + Return the compressed list of VLANs to be defined on this switch. + Exposed in avd_switch_facts. - Return the compressed list of vlans to be defined on this switch + The returned VLANs are the available VLANs after local network-service + filtering and any upstream availability filtering for VLAN-carrying uplink types. Ex. "1-100, 201-202" This excludes the optional "uplink_native_vlan" if that vlan is not used for anything else. This is to ensure that native vlan is not necessarily permitted on the uplink trunk. """ - return list_compress(self._vlans) + return list_compress(list(self._available_vlans)) def _parse_adapter_settings( self: EosDesignsFactsGeneratorProtocol, @@ -152,6 +156,14 @@ def _downstream_switch_endpoint_vlans_and_trunk_groups(self: EosDesignsFactsGene Traverse any downstream L2 switches so ensure we can provide connectivity to any vlans / trunk groups used by them. """ + return self.get_downstream_switch_endpoint_vlans_and_trunk_groups(frozenset()) + + def get_downstream_switch_endpoint_vlans_and_trunk_groups(self: EosDesignsFactsGeneratorProtocol, path: frozenset[str]) -> tuple[set, set]: + """ + Return set of vlans and set of trunk groups used by downstream switches. + + The path is used to avoid circular recursion for explicitly configured L2 rings. + """ if not self.shared_utils.any_network_services: return set(), set() @@ -159,8 +171,8 @@ def _downstream_switch_endpoint_vlans_and_trunk_groups(self: EosDesignsFactsGene trunk_groups = set() for downlink_switch in self._downlink_switches: downlink_switch_facts = self.get_peer_facts_generator(downlink_switch) - if downlink_switch_facts.shared_utils.uplink_type == "port-channel": - downlink_switch_endpoint_vlans, downlink_switch_endpoint_trunk_groups = downlink_switch_facts._endpoint_vlans_and_trunk_groups + if downlink_switch_facts.shared_utils.uplink_type in ["port-channel", "l2-ethernet"]: + downlink_switch_endpoint_vlans, downlink_switch_endpoint_trunk_groups = downlink_switch_facts.get_endpoint_vlans_and_trunk_groups(path) vlans.update(downlink_switch_endpoint_vlans) trunk_groups.update(downlink_switch_endpoint_trunk_groups) @@ -174,8 +186,20 @@ def _endpoint_vlans_and_trunk_groups(self: EosDesignsFactsGeneratorProtocol) -> The trunk groups are those used by connected_endpoints on this switch, downstream switches but NOT mlag peer (since we would have circular references then). """ + return self.get_endpoint_vlans_and_trunk_groups(frozenset()) + + def get_endpoint_vlans_and_trunk_groups(self: EosDesignsFactsGeneratorProtocol, path: frozenset[str]) -> tuple[set, set]: + """ + Return set of vlans and set of trunk groups. + + The path is used to avoid circular recursion for explicitly configured L2 rings. + """ + if self.shared_utils.hostname in path: + return set(), set() + + path = path.union((self.shared_utils.hostname,)) local_endpoint_vlans, local_endpoint_trunk_groups = self._local_endpoint_vlans_and_trunk_groups - downstream_switch_endpoint_vlans, downstream_switch_endpoint_trunk_groups = self._downstream_switch_endpoint_vlans_and_trunk_groups + downstream_switch_endpoint_vlans, downstream_switch_endpoint_trunk_groups = self.get_downstream_switch_endpoint_vlans_and_trunk_groups(path) return local_endpoint_vlans.union(downstream_switch_endpoint_vlans), local_endpoint_trunk_groups.union(downstream_switch_endpoint_trunk_groups) @cached_property @@ -249,29 +273,93 @@ def endpoint_trunk_groups(self: EosDesignsFactsGeneratorProtocol) -> EosDesignsF return EosDesignsFactsProtocol.EndpointTrunkGroups(natural_sort(self._endpoint_trunk_groups)) @cached_property - def _vlans(self: EosDesignsFactsGeneratorProtocol) -> list[int]: + def candidate_vlans(self: EosDesignsFactsGeneratorProtocol) -> frozenset[int]: """ - Return list of vlans after filtering network services. + Return set of candidate VLANs selected from network services for this switch. + + Candidate VLANs are the locally requested VLANs after applying this switch's + network-services filters: filter.tenants, filter.tags and filter.only_vlans_in_use. + They are not yet filtered against VLAN availability on uplink switches. - The filter is based on filter.tenants, filter.tags and filter.only_vlans_in_use. + Ex. {1, 2, 3, 4, 201, 3021} - Ex. [1, 2, 3 ,4 ,201, 3021] + Using frozenset to protect against accidental mutation when called indirectly from other devices. """ if not self.shared_utils.any_network_services: - return [] - - vlans = [] - for network_services_key in self.inputs._dynamic_keys.network_services: - tenants = network_services_key.value - for tenant in tenants: - if not set(self.shared_utils.node_config.filter.tenants).intersection([tenant.name, "all"]): - # Not matching tenant filters. Skipping this tenant. - continue + return frozenset() + + tenant_filter = set(self.shared_utils.node_config.filter.tenants) + accepted_tenants = ( + tenant + for network_services_key in self.inputs._dynamic_keys.network_services + for tenant in network_services_key.value + if tenant_filter.intersection((tenant.name, "all")) + ) + + return frozenset( + vlan_id + for tenant in accepted_tenants + for vlan_id in chain( + (svi.id for vrf in tenant.vrfs for svi in vrf.svis if self._is_accepted_vlan(svi)), + (l2vlan.id for l2vlan in tenant.l2vlans if self._is_accepted_vlan(l2vlan)), + ) + ) + + @cached_property + def _available_vlans(self: EosDesignsFactsGeneratorProtocol) -> frozenset[int]: + """ + Return set of VLANs available on this switch. - vlans.extend(svi.id for vrf in tenant.vrfs for svi in vrf.svis if self._is_accepted_vlan(svi)) - vlans.extend(l2vlan.id for l2vlan in tenant.l2vlans if self._is_accepted_vlan(l2vlan)) + Available VLANs are candidate VLANs that can actually be carried by this switch. + For VLAN-carrying uplink types, this means the switch's candidate VLANs + must also be available on all fabric uplink switches. This prevents + allowing VLANs on downstream trunks when the VLAN cannot be reached + through every parent path. - return vlans + Inband management VLANs are added after upstream availability filtering to + preserve the existing behavior where a child may allow its inband management + VLAN towards a parent before the parent VLAN fact includes it. + """ + available_vlans = self.get_available_vlans(frozenset()) + return available_vlans if available_vlans is not None else frozenset() + + def get_available_vlans(self: EosDesignsFactsGeneratorProtocol, path: frozenset[str]) -> frozenset[int] | None: + """ + Return set of VLANs available on this switch. + + Returns None when the current path has already visited this switch. The + caller should treat None as a cyclic reference and ignore that uplink as + an availability constraint. + """ + if self.shared_utils.hostname in path: + return None + + path = path.union((self.shared_utils.hostname,)) + candidate_vlans = self.candidate_vlans + + if self.shared_utils.uplink_type not in ["port-channel", "l2-ethernet", "lan"]: + return candidate_vlans + + available_vlans = set(candidate_vlans) + uplink_switches = unique(self.shared_utils.uplink_switches) + uplink_switches = [uplink_switch for uplink_switch in uplink_switches if uplink_switch in self.shared_utils.all_fabric_devices] + for uplink_switch in uplink_switches: + if not available_vlans: + break + + uplink_switch_facts = self.get_peer_facts_generator(uplink_switch) + uplink_switch_available_vlans = uplink_switch_facts.get_available_vlans(path) + if uplink_switch_available_vlans is None: + # Not restricting further since this was a cyclic reference. + continue + available_vlans.intersection_update(uplink_switch_available_vlans) + + if self.shared_utils.configure_inband_mgmt or self.shared_utils.configure_inband_mgmt_ipv6: + # Preserve existing behavior where the inband management VLAN is allowed + # towards a parent even before the parent VLAN fact includes it. + available_vlans.add(self.shared_utils.node_config.inband_mgmt_vlan) + + return frozenset(available_vlans) def _is_accepted_vlan( self: EosDesignsFactsGeneratorProtocol, diff --git a/python-avd/pyavd/_eos_designs/schema/__init__.py b/python-avd/pyavd/_eos_designs/schema/__init__.py index 843b7bd895d..602270d2d5e 100644 --- a/python-avd/pyavd/_eos_designs/schema/__init__.py +++ b/python-avd/pyavd/_eos_designs/schema/__init__.py @@ -7225,7 +7225,7 @@ def __init__( """ - UplinkType: TypeAlias = Literal["p2p", "port-channel", "p2p-vrfs", "lan"] + UplinkType: TypeAlias = Literal["p2p", "port-channel", "p2p-vrfs", "lan", "l2-ethernet"] class UplinkInterfaces(AvdList[str]): """Subclass of AvdList with `str` items.""" @@ -12373,7 +12373,7 @@ def __init__( """ - UplinkType: TypeAlias = Literal["p2p", "port-channel", "p2p-vrfs", "lan"] + UplinkType: TypeAlias = Literal["p2p", "port-channel", "p2p-vrfs", "lan", "l2-ethernet"] class UplinkInterfaces(AvdList[str]): """Subclass of AvdList with `str` items.""" @@ -26287,7 +26287,7 @@ def __init__(self, *, l1: bool | UndefinedType = Undefined, l2: bool | Undefined """ - UplinkType: TypeAlias = Literal["p2p", "port-channel", "p2p-vrfs", "lan"] + UplinkType: TypeAlias = Literal["p2p", "port-channel", "p2p-vrfs", "lan", "l2-ethernet"] class IpAddressing(AvdModel): """Subclass of AvdModel.""" @@ -26600,6 +26600,13 @@ def __init__( the uplink switch also has the VLAN permitted by tag/tenant filtering. + `port-channel` and + `l2-ethernet` options configures L2 trunks carrying all active VLANs permitted by tag/tenant + filtering. + Redundant L2 ring VLAN propagation is only calculated for links towards + `uplink_switches`. + For ring redundancy, define the ring links on both participating switches. + Default value: `"p2p"` """ vtep: bool @@ -26729,6 +26736,13 @@ def __init__( subinterfaces for each SVI defined under the VRFs in `network_services` as long as the uplink switch also has the VLAN permitted by tag/tenant filtering. + + `port-channel` and + `l2-ethernet` options configures L2 trunks carrying all active VLANs permitted by tag/tenant + filtering. + Redundant L2 ring VLAN propagation is only calculated for links towards + `uplink_switches`. + For ring redundancy, define the ring links on both participating switches. vtep: Is this switch an EVPN VTEP. mpls_lsr: Is this switch an MPLS LSR. ip_addressing: @@ -26814,7 +26828,7 @@ def __init__(self, *, l1: bool | UndefinedType = Undefined, l2: bool | Undefined """ - UplinkType: TypeAlias = Literal["p2p", "port-channel", "p2p-vrfs", "lan"] + UplinkType: TypeAlias = Literal["p2p", "port-channel", "p2p-vrfs", "lan", "l2-ethernet"] class IpAddressing(AvdModel): """Subclass of AvdModel.""" @@ -27127,6 +27141,13 @@ def __init__( the uplink switch also has the VLAN permitted by tag/tenant filtering. + `port-channel` and + `l2-ethernet` options configures L2 trunks carrying all active VLANs permitted by tag/tenant + filtering. + Redundant L2 ring VLAN propagation is only calculated for links towards + `uplink_switches`. + For ring redundancy, define the ring links on both participating switches. + Default value: `"p2p"` """ vtep: bool @@ -27256,6 +27277,13 @@ def __init__( subinterfaces for each SVI defined under the VRFs in `network_services` as long as the uplink switch also has the VLAN permitted by tag/tenant filtering. + + `port-channel` and + `l2-ethernet` options configures L2 trunks carrying all active VLANs permitted by tag/tenant + filtering. + Redundant L2 ring VLAN propagation is only calculated for links towards + `uplink_switches`. + For ring redundancy, define the ring links on both participating switches. vtep: Is this switch an EVPN VTEP. mpls_lsr: Is this switch an MPLS LSR. ip_addressing: @@ -37433,7 +37461,7 @@ def __init__( """ - UplinkType: TypeAlias = Literal["p2p", "port-channel", "p2p-vrfs", "lan"] + UplinkType: TypeAlias = Literal["p2p", "port-channel", "p2p-vrfs", "lan", "l2-ethernet"] class UplinkInterfaces(AvdList[str]): """Subclass of AvdList with `str` items.""" @@ -42558,7 +42586,7 @@ def __init__( """ - UplinkType: TypeAlias = Literal["p2p", "port-channel", "p2p-vrfs", "lan"] + UplinkType: TypeAlias = Literal["p2p", "port-channel", "p2p-vrfs", "lan", "l2-ethernet"] class UplinkInterfaces(AvdList[str]): """Subclass of AvdList with `str` items.""" @@ -47646,7 +47674,7 @@ def __init__( """ - UplinkType: TypeAlias = Literal["p2p", "port-channel", "p2p-vrfs", "lan"] + UplinkType: TypeAlias = Literal["p2p", "port-channel", "p2p-vrfs", "lan", "l2-ethernet"] class UplinkInterfaces(AvdList[str]): """Subclass of AvdList with `str` items.""" @@ -52797,7 +52825,7 @@ def __init__( """ - UplinkType: TypeAlias = Literal["p2p", "port-channel", "p2p-vrfs", "lan"] + UplinkType: TypeAlias = Literal["p2p", "port-channel", "p2p-vrfs", "lan", "l2-ethernet"] class UplinkInterfaces(AvdList[str]): """Subclass of AvdList with `str` items.""" @@ -71287,7 +71315,7 @@ def __init__( """ - UplinkType: TypeAlias = Literal["p2p", "port-channel", "p2p-vrfs", "lan"] + UplinkType: TypeAlias = Literal["p2p", "port-channel", "p2p-vrfs", "lan", "l2-ethernet"] class UplinkInterfaces(AvdList[str]): """Subclass of AvdList with `str` items.""" @@ -76412,7 +76440,7 @@ def __init__( """ - UplinkType: TypeAlias = Literal["p2p", "port-channel", "p2p-vrfs", "lan"] + UplinkType: TypeAlias = Literal["p2p", "port-channel", "p2p-vrfs", "lan", "l2-ethernet"] class UplinkInterfaces(AvdList[str]): """Subclass of AvdList with `str` items.""" @@ -81500,7 +81528,7 @@ def __init__( """ - UplinkType: TypeAlias = Literal["p2p", "port-channel", "p2p-vrfs", "lan"] + UplinkType: TypeAlias = Literal["p2p", "port-channel", "p2p-vrfs", "lan", "l2-ethernet"] class UplinkInterfaces(AvdList[str]): """Subclass of AvdList with `str` items.""" @@ -86651,7 +86679,7 @@ def __init__( """ - UplinkType: TypeAlias = Literal["p2p", "port-channel", "p2p-vrfs", "lan"] + UplinkType: TypeAlias = Literal["p2p", "port-channel", "p2p-vrfs", "lan", "l2-ethernet"] class UplinkInterfaces(AvdList[str]): """Subclass of AvdList with `str` items.""" diff --git a/python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml b/python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml index c4a91d3a288..cd9864fe1ee 100644 --- a/python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml +++ b/python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml @@ -10901,6 +10901,7 @@ $defs: - port-channel - p2p-vrfs - lan + - l2-ethernet description: 'Override the default `uplink_type` set at the `node_type_key` level. @@ -13016,6 +13017,7 @@ $defs: - port-channel - p2p-vrfs - lan + - l2-ethernet default: p2p description: '`uplink_type` must be `p2p`, `p2p-vrfs` or `lan` if `vtep` or `underlay_router` is true. @@ -13046,7 +13048,16 @@ $defs: subinterfaces for each SVI defined under the VRFs in `network_services` as long as the uplink switch also - has the VLAN permitted by tag/tenant filtering.' + has the VLAN permitted by tag/tenant filtering. + + + `port-channel` and `l2-ethernet` options configures L2 trunks carrying + all active VLANs permitted by tag/tenant filtering. + + Redundant L2 ring VLAN propagation is only calculated for links towards + `uplink_switches`. + + For ring redundancy, define the ring links on both participating switches.' vtep: type: bool default: false diff --git a/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_node_type.schema.yml b/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_node_type.schema.yml index 48564d4505e..e171aac0829 100644 --- a/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_node_type.schema.yml +++ b/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_node_type.schema.yml @@ -200,6 +200,7 @@ $defs: - port-channel - p2p-vrfs - lan + - l2-ethernet description: |- Override the default `uplink_type` set at the `node_type_key` level. `uplink_type` must be "p2p" if `vtep` or `underlay_router` is true for the `node_type_key` definition. diff --git a/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_node_type_keys.schema.yml b/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_node_type_keys.schema.yml index f47260e5cca..fc8a21e6201 100644 --- a/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_node_type_keys.schema.yml +++ b/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_node_type_keys.schema.yml @@ -140,6 +140,7 @@ $defs: - port-channel - p2p-vrfs - lan + - l2-ethernet default: p2p description: |- `uplink_type` must be `p2p`, `p2p-vrfs` or `lan` if `vtep` or `underlay_router` is true. @@ -156,6 +157,10 @@ $defs: For `lan`, a single uplink interface is supported and will be configured as an L3 Interface with subinterfaces for each SVI defined under the VRFs in `network_services` as long as the uplink switch also has the VLAN permitted by tag/tenant filtering. + + `port-channel` and `l2-ethernet` options configures L2 trunks carrying all active VLANs permitted by tag/tenant filtering. + Redundant L2 ring VLAN propagation is only calculated for links towards `uplink_switches`. + For ring redundancy, define the ring links on both participating switches. vtep: type: bool default: false diff --git a/python-avd/pyavd/_eos_designs/shared_utils/filtered_tenants.py b/python-avd/pyavd/_eos_designs/shared_utils/filtered_tenants.py index f300305dad2..8cfa4651a05 100644 --- a/python-avd/pyavd/_eos_designs/shared_utils/filtered_tenants.py +++ b/python-avd/pyavd/_eos_designs/shared_utils/filtered_tenants.py @@ -9,7 +9,7 @@ from pyavd._eos_cli_config_gen.schema import EosCliConfigGen from pyavd._eos_designs.schema import EosDesigns from pyavd._errors import AristaAvdError, AristaAvdInvalidInputsError, AristaAvdMissingVariableError -from pyavd._utils import default, unique +from pyavd._utils import default from pyavd._utils.password_utils.password import ospf_message_digest_encrypt, ospf_simple_encrypt from pyavd.j2filters import natural_sort, range_expand @@ -196,25 +196,12 @@ def accepted_vlans(self: SharedUtilsProtocol) -> set[int]: """ The 'vlans' switch fact is a string representing a vlan range (ex. "1-200"). - For l2 switches return intersection of vlans from this switch and vlans from uplink switches. - For anything else return the expanded vlans from this switch. + Return the expanded vlans from this switch after facts have resolved local filtering and VLAN availability. """ switch_vlans = self.switch_facts.vlans if not switch_vlans: return set() - switch_vlans_list = range_expand(switch_vlans) - accepted_vlans = {int(vlan) for vlan in switch_vlans_list} - if self.uplink_type != "port-channel": - return accepted_vlans - - uplink_switches = unique(self.uplink_switches) - uplink_switches = [uplink_switch for uplink_switch in uplink_switches if uplink_switch in self.all_fabric_devices] - for uplink_switch in uplink_switches: - uplink_switch_facts = self.get_peer_facts(uplink_switch, required=True) - uplink_switch_vlans_set = {int(vlan) for vlan in range_expand(uplink_switch_facts.vlans)} - accepted_vlans = accepted_vlans.intersection(uplink_switch_vlans_set) - - return accepted_vlans + return {int(vlan) for vlan in range_expand(switch_vlans)} def is_accepted_vrf(self: SharedUtilsProtocol, vrf: EosDesigns._DynamicKeys.DynamicNetworkServicesItem.NetworkServicesItem.VrfsItem) -> bool: """ diff --git a/python-avd/pyavd/_eos_designs/shared_utils/inband_management.py b/python-avd/pyavd/_eos_designs/shared_utils/inband_management.py index f602e1f9285..341a9cfff26 100644 --- a/python-avd/pyavd/_eos_designs/shared_utils/inband_management.py +++ b/python-avd/pyavd/_eos_designs/shared_utils/inband_management.py @@ -23,11 +23,11 @@ class InbandManagementMixin(Protocol): @cached_property def configure_inband_mgmt(self: SharedUtilsProtocol) -> bool: - return bool(self.uplink_type == "port-channel" and self.inband_mgmt_ip) + return bool(self.uplink_type in ["port-channel", "l2-ethernet"] and self.inband_mgmt_ip) @cached_property def configure_inband_mgmt_ipv6(self: SharedUtilsProtocol) -> bool: - return bool(self.uplink_type == "port-channel" and self.inband_mgmt_ipv6_address) + return bool(self.uplink_type in ["port-channel", "l2-ethernet"] and self.inband_mgmt_ipv6_address) @cached_property def configure_parent_for_inband_mgmt(self: SharedUtilsProtocol) -> bool: diff --git a/python-avd/pyavd/_eos_designs/shared_utils/node_type.py b/python-avd/pyavd/_eos_designs/shared_utils/node_type.py index 71b1381292b..0c531ba314d 100644 --- a/python-avd/pyavd/_eos_designs/shared_utils/node_type.py +++ b/python-avd/pyavd/_eos_designs/shared_utils/node_type.py @@ -5,12 +5,14 @@ from functools import cached_property from re import search -from typing import TYPE_CHECKING, Literal, Protocol +from typing import TYPE_CHECKING, Protocol from pyavd._errors import AristaAvdInvalidInputsError from pyavd._utils import default if TYPE_CHECKING: + from pyavd._eos_designs.schema import EosDesigns + from . import SharedUtilsProtocol @@ -66,7 +68,7 @@ def underlay_router(self: SharedUtilsProtocol) -> bool: return self.node_type_key_data.underlay_router @cached_property - def uplink_type(self: SharedUtilsProtocol) -> Literal["p2p", "port-channel", "p2p-vrfs", "lan"]: + def uplink_type(self: SharedUtilsProtocol) -> EosDesigns.NodeTypeKeysItem.UplinkType: """ Uplink type. diff --git a/python-avd/pyavd/_eos_designs/structured_config/network_services/vlans.py b/python-avd/pyavd/_eos_designs/structured_config/network_services/vlans.py index fdd61847cf8..4d56c032f91 100644 --- a/python-avd/pyavd/_eos_designs/structured_config/network_services/vlans.py +++ b/python-avd/pyavd/_eos_designs/structured_config/network_services/vlans.py @@ -128,7 +128,7 @@ def _get_vlan_config( trunk_groups = self._local_endpoint_trunk_groups.intersection(trunk_groups) if self.shared_utils.mlag: trunk_groups.add(self.inputs.trunk_groups.mlag.name) - if self.shared_utils.uplink_type == "port-channel": + if self.shared_utils.uplink_type in ["port-channel", "l2-ethernet"]: trunk_groups.add(self.inputs.trunk_groups.uplink.name) # Add trunk groups required for underlay if vlans_vlan.id in self.shared_utils.underlay_vlan_trunk_groups: