Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor(eos_designs): Network Services ethernet interfaces refactoring to classes #4976

Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
4a6e2d0
Refactor(eos_designs): Network Services ethernet interfaces refactori…
gmuloc Feb 4, 2025
c846eb6
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 4, 2025
e87f9e0
Test: Fix negative unit tests
gmuloc Feb 4, 2025
e553498
Merge branch 'devel' into refactor/eos_designs/network-services/ether…
gmuloc Feb 4, 2025
06e453c
Refactor: Reduce complexity of the main function
gmuloc Feb 4, 2025
e4f9d4c
Refactor: Booh ClassVar mutant bad
gmuloc Feb 4, 2025
2fe25ae
Merge branch 'devel' into refactor/eos_designs/network-services/ether…
gmuloc Feb 5, 2025
9ac8e8f
Merge branch 'devel' into refactor/eos_designs/network-services/ether…
gmuloc Feb 6, 2025
964038d
Refactor: Addres PR comments
gmuloc Feb 6, 2025
60bf4e2
Merge branch 'devel' into refactor/eos_designs/network-services/ether…
gmuloc Feb 7, 2025
11661cf
Merge branch 'devel' into refactor/eos_designs/network-services/ether…
gmuloc Feb 7, 2025
db4ae1f
Test: Moleculing the molecule
gmuloc Feb 7, 2025
ea7a5ca
Update python-avd/pyavd/_eos_designs/structured_config/network_servic…
gmuloc Feb 10, 2025
ab38e92
Merge branch 'devel' into refactor/eos_designs/network-services/ether…
gmuloc Feb 10, 2025
bfe830b
Update ansible_collections/arista/avd/molecule/eos_designs_negative_u…
gmuloc Feb 10, 2025
9e1564f
Merge branch 'devel' into refactor/eos_designs/network-services/ether…
gmuloc Feb 11, 2025
9701e7f
Apply suggestions from code review
gmuloc Feb 11, 2025
d32b297
Merge branch 'devel' into refactor/eos_designs/network-services/ether…
gmuloc Feb 11, 2025
826a4af
Merge branch 'devel' into refactor/eos_designs/network-services/ether…
gmuloc Feb 12, 2025
7f90a9a
Refactor: Use obtain for internet exit ethernet interface configuration
gmuloc Feb 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
aaa_root:
disabled: true
config_end: true
enable_password:
disabled: true
ethernet_interfaces:
- name: Ethernet6.1000
shutdown: false
encapsulation_vlan:
client:
encapsulation: dot1q
vlan: 1000
network:
encapsulation: client
peer_type: point_to_point_service
- name: Ethernet6
shutdown: false
peer_type: l3_interface
switchport:
enabled: false
hostname: duplicate-interfaces-point-to-point-services-3
ip_igmp_snooping:
globally_enabled: true
ip_routing: true
is_deployed: true
loopback_interfaces:
- name: Loopback0
description: ROUTER_ID
shutdown: false
ip_address: 10.42.0.42/32
management_api_http:
enable_https: true
enable_vrfs:
- name: MGMT
metadata:
fabric_name: EOS_DESIGNS_FAILURES
patch_panel:
patches:
- name: TEN_A_site2_site5_eline_port_based_1000
enabled: true
connectors:
- id: '1'
type: interface
endpoint: Ethernet6.1000
- id: '2'
type: pseudowire
endpoint: bgp vpws TENANT_A pseudowire TEN_A_site2_site5_eline_port_based_1000
- name: TEN_B_site2_site5_eline_port_based_1000
enabled: true
connectors:
- id: '1'
type: interface
endpoint: Ethernet6.1000
- id: '2'
type: pseudowire
endpoint: bgp vpws TENANT_B pseudowire TEN_B_site2_site5_eline_port_based_1000
prefix_lists:
- name: PL-LOOPBACKS-EVPN-OVERLAY
sequence_numbers:
- sequence: 10
action: permit 10.42.0.0/24 eq 32
route_maps:
- name: RM-CONN-2-BGP
sequence_numbers:
- sequence: 10
type: permit
match:
- ip address prefix-list PL-LOOPBACKS-EVPN-OVERLAY
router_bfd:
multihop:
interval: 300
min_rx: 300
multiplier: 3
router_bgp:
as: '42'
router_id: 10.42.0.42
maximum_paths:
paths: 4
ecmp: 4
updates:
wait_install: true
bgp:
default:
ipv4_unicast: false
peer_groups:
- name: IPv4-UNDERLAY-PEERS
type: ipv4
send_community: all
maximum_routes: 12000
- name: MPLS-OVERLAY-PEERS
type: mpls
remote_as: '42'
update_source: Loopback0
bfd: true
send_community: all
maximum_routes: 0
redistribute:
connected:
enabled: true
route_map: RM-CONN-2-BGP
address_family_evpn:
neighbor_default:
encapsulation: mpls
peer_groups:
- name: MPLS-OVERLAY-PEERS
activate: true
address_family_ipv4:
peer_groups:
- name: IPv4-UNDERLAY-PEERS
activate: true
- name: MPLS-OVERLAY-PEERS
activate: false
service_routing_protocols_model: multi-agent
transceiver_qsfp_default_mode_4x10: true
vlan_internal_order:
allocation: ascending
range:
beginning: 1006
ending: 1199
vrfs:
- name: MGMT
ip_routing: false
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ node_type_keys:
l2: true
l3: true
default_overlay_routing_protocol: ibgp
default_overlay_address_families: [ evpn ]
default_overlay_address_families: [evpn]
default_evpn_encapsulation: mpls

pe:
Expand All @@ -30,29 +30,30 @@ tenants:
- name: TEN_A_site2_site5_eline_port_based
endpoints:
- id: 26
nodes: [ "duplicate-interfaces-point-to-point-services-1" ]
interfaces: [ "Ethernet6" ]
nodes: ["duplicate-interfaces-point-to-point-services-1"]
interfaces: ["Ethernet6"]
port_channel:
mode: 'active'
mode: "active"
- id: 27
nodes: [ "duplicate-interfaces-point-to-point-services-2" ]
interfaces: [ "Ethernet6" ]
nodes: ["duplicate-interfaces-point-to-point-services-2"]
interfaces: ["Ethernet6"]
port_channel:
mode: 'active'
mode: "active"

- name: TENANT_B
point_to_point_services:
- name: TEN_B_site2_site5_eline_port_based
endpoints:
- id: 57
nodes: [ "duplicate-interfaces-point-to-point-services-1" ]
interfaces: [ "Ethernet6" ]
nodes: ["duplicate-interfaces-point-to-point-services-1"]
interfaces: ["Ethernet6"]
- id: 58
nodes: [ "duplicate-interfaces-point-to-point-services-3" ]
interfaces: [ "Ethernet6" ]
nodes: ["duplicate-interfaces-point-to-point-services-3"]
interfaces: ["Ethernet6"]
port_channel:
mode: 'active'
mode: "active"

expected_error_message: >-
Found duplicate objects with conflicting data while generating configuration for Ethernet Interfaces defined under point_to_point_services.
{'name': 'Ethernet6', 'switchport': {'enabled': False}} conflicts with {'name': 'Ethernet6', 'switchport': None}.
Found duplicate objects with conflicting data while generating configuration for EthernetInterfaces.
gmuloc marked this conversation as resolved.
Show resolved Hide resolved
{'name': 'Ethernet6', 'shutdown': False, 'peer_type': 'point_to_point_service', 'switchport': {'enabled': False}}
conflicts with {'name': 'Ethernet6', 'shutdown': False, 'channel_group': {'id': 6, 'mode': 'active'}, 'peer_type': 'point_to_point_service'}.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ node_type_keys:
l2: true
l3: true
default_overlay_routing_protocol: ibgp
default_overlay_address_families: [ evpn ]
default_overlay_address_families: [evpn]
default_evpn_encapsulation: mpls

pe:
Expand All @@ -30,31 +30,32 @@ tenants:
- name: TEN_A_site2_site5_eline_port_based
endpoints:
- id: 27
nodes: [ "duplicate-interfaces-point-to-point-services-2" ]
interfaces: [ "Ethernet6" ]
nodes: ["duplicate-interfaces-point-to-point-services-2"]
interfaces: ["Ethernet6"]
port_channel:
mode: 'active'
mode: "active"
- id: 26
nodes: [ "duplicate-interfaces-point-to-point-services-1" ]
interfaces: [ "Ethernet6" ]
nodes: ["duplicate-interfaces-point-to-point-services-1"]
interfaces: ["Ethernet6"]
port_channel:
mode: 'active'
mode: "active"

- name: TENANT_B
point_to_point_services:
- name: TEN_B_site2_site5_eline_port_based
endpoints:
- id: 57
nodes: [ "duplicate-interfaces-point-to-point-services-2" ]
interfaces: [ "Ethernet6" ]
nodes: ["duplicate-interfaces-point-to-point-services-2"]
interfaces: ["Ethernet6"]
port_channel:
mode: 'on'
mode: "on"
- id: 58
nodes: [ "duplicate-interfaces-point-to-point-services-3" ]
interfaces: [ "Ethernet6" ]
nodes: ["duplicate-interfaces-point-to-point-services-3"]
interfaces: ["Ethernet6"]
port_channel:
mode: 'on'
mode: "on"

expected_error_message: >-
Found duplicate objects with conflicting data while generating configuration for Ethernet Interfaces defined under point_to_point_services.
{'name': 'Ethernet6', 'channel_group': {'id': 6, 'mode': 'on'}} conflicts with {'name': 'Ethernet6', 'channel_group': {'id': 6, 'mode': 'active'}}.
Found duplicate objects with conflicting data while generating configuration for EthernetInterfaces.
{'name': 'Ethernet6', 'shutdown': False, 'channel_group': {'id': 6, 'mode': 'on'}, 'peer_type': 'point_to_point_service'} conflicts with
{'name': 'Ethernet6', 'shutdown': False, 'channel_group': {'id': 6, 'mode': 'active'}, 'peer_type': 'point_to_point_service'}.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ node_type_keys:
l2: true
l3: true
default_overlay_routing_protocol: ibgp
default_overlay_address_families: [ evpn ]
default_overlay_address_families: [evpn]
default_evpn_encapsulation: mpls

pe:
Expand All @@ -33,11 +33,11 @@ tenants:
- number: 1000
endpoints:
- id: 26
nodes: [ "duplicate-interfaces-point-to-point-services-3" ]
interfaces: [ "Ethernet6" ]
nodes: ["duplicate-interfaces-point-to-point-services-3"]
interfaces: ["Ethernet6"]
- id: 25
nodes: [ "duplicate-interfaces-point-to-point-services-1" ]
interfaces: [ "Ethernet6" ]
nodes: ["duplicate-interfaces-point-to-point-services-1"]
interfaces: ["Ethernet6"]

- name: TENANT_B
point_to_point_services:
Expand All @@ -46,12 +46,14 @@ tenants:
- number: 1000
endpoints:
- id: 57
nodes: [ "duplicate-interfaces-point-to-point-services-3" ]
interfaces: [ "Ethernet6" ]
nodes: ["duplicate-interfaces-point-to-point-services-3"]
interfaces: ["Ethernet6"]
- id: 58
nodes: [ "duplicate-interfaces-point-to-point-services-2" ]
interfaces: [ "Ethernet6" ]
nodes: ["duplicate-interfaces-point-to-point-services-2"]
interfaces: ["Ethernet6"]

expected_error_message: >-
Found duplicate objects with conflicting data while generating configuration for Ethernet Interfaces defined under point_to_point_services.
{'name': 'Ethernet6.1000'} conflicts with {'name': 'Ethernet6.1000'}.
Found duplicate objects with conflicting data while generating configuration for EthernetInterfaces.
{'name': 'Ethernet6.1000', 'shutdown': False, 'peer_type': 'point_to_point_service'} conflicts with
{'name': 'Ethernet6.1000', 'shutdown': False, 'encapsulation_vlan': {'client': {'encapsulation': 'dot1q', 'vlan': 1000},
'network': {'encapsulation': 'client'}}, 'peer_type': 'point_to_point_service'}.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ node_type_keys:
l2: true
l3: true
default_overlay_routing_protocol: ibgp
default_overlay_address_families: [ evpn ]
default_overlay_address_families: [evpn]
default_evpn_encapsulation: mpls

pe:
Expand All @@ -29,7 +29,11 @@ tenants:
vrfs:
- name: TEST
l3_interfaces:
- nodes: ["duplicate-interfaces-point-to-point-services-4", "some_other_device"]
- nodes:
[
"duplicate-interfaces-point-to-point-services-4",
"some_other_device",
]
gmuloc marked this conversation as resolved.
Show resolved Hide resolved
gmuloc marked this conversation as resolved.
Show resolved Hide resolved
interfaces: ["Ethernet6.1000", "some_other_interface"]
ip_addresses: [10.42.255.0/31, 10.42.255.1/31]

Expand All @@ -41,13 +45,15 @@ tenants:
- number: 1000
endpoints:
- id: 26
nodes: [ "duplicate-interfaces-point-to-point-services-4" ]
interfaces: [ "Ethernet6" ] # interface name would be Ethernet6.1000 (duplicate)
nodes: ["duplicate-interfaces-point-to-point-services-4"]
interfaces: ["Ethernet6"] # interface name would be Ethernet6.1000 (duplicate)
- id: 25
nodes: [ "duplicate-interfaces-point-to-point-services-3" ]
interfaces: [ "Ethernet6" ]
nodes: ["duplicate-interfaces-point-to-point-services-3"]
interfaces: ["Ethernet6"]

expected_error_message: >-
Found duplicate objects with conflicting data while generating configuration for Ethernet Interfaces defined under point_to_point_services.
{'name': 'Ethernet6.1000', 'encapsulation_vlan': {'client': {'encapsulation': 'dot1q', 'vlan': 1000}, 'network': {'encapsulation': 'client'}},
'peer_type': 'point_to_point_service'} conflicts with {'name': 'Ethernet6.1000', 'encapsulation_vlan': None, 'peer_type': 'l3_interface'}.
Found duplicate objects with conflicting data while generating configuration for EthernetInterfaces.
gmuloc marked this conversation as resolved.
Show resolved Hide resolved
{'name': 'Ethernet6.1000', 'shutdown': False, 'encapsulation_vlan': {'client': {'encapsulation': 'dot1q', 'vlan': 1000},
ClausHolbechArista marked this conversation as resolved.
Show resolved Hide resolved
'network': {'encapsulation': 'client'}}, 'peer_type': 'point_to_point_service'} conflicts with
{'name': 'Ethernet6.1000', 'shutdown': False, 'vrf': 'TEST', 'encapsulation_dot1q': {'vlan': 1000},
'ip_address': '10.42.255.0/31', 'peer_type': 'l3_interface'}.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ node_type_keys:
l2: true
l3: true
default_overlay_routing_protocol: ibgp
default_overlay_address_families: [ evpn ]
default_overlay_address_families: [evpn]
default_evpn_encapsulation: mpls

pe:
Expand Down Expand Up @@ -49,6 +49,7 @@ tenants:
- duplicate-l3-interfaces-network-services

expected_error_message: >-
Found duplicate objects with conflicting data while generating configuration for Ethernet Interfaces defined under l3_interfaces.
{'name': 'Ethernet6.101', 'vrf': 'TENANT_B_WAN', 'description': 'TENANT_B_SITE_5', 'ip_address': '192.168.48.2/31'} conflicts with
{'name': 'Ethernet6.101', 'vrf': 'TENANT_B_WAN', 'description': 'TENANT_B_SITE_3_OSPF', 'ip_address': '192.168.48.4/31'}.
Found duplicate objects with conflicting data while generating configuration for EthernetInterfaces.
{'name': 'Ethernet6.101', 'description': 'TENANT_B_SITE_5', 'shutdown': False, 'ip_address': '192.168.48.2/31', 'peer_type': 'l3_interface'}
conflicts with {'name': 'Ethernet6.101', 'description': 'TENANT_B_SITE_3_OSPF', 'shutdown': False, 'vrf': 'TENANT_B_WAN',
'encapsulation_dot1q': {'vlan': 101}, 'ip_address': '192.168.48.4/31', 'peer_type': 'l3_interface'}.
Loading