Skip to content

Commit

Permalink
Feat(eos_designs): Add platform match criteria for network_ports
Browse files Browse the repository at this point in the history
  • Loading branch information
kpbush30 committed Dec 9, 2024
1 parent b395650 commit 6d26f6e
Show file tree
Hide file tree
Showing 10 changed files with 166 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,24 @@ interface Ethernet17
no shutdown
switchport
!
interface Ethernet23
description PCs
no shutdown
switchport access vlan 100
switchport mode access
switchport
spanning-tree portfast
spanning-tree bpdufilter enable
!
interface Ethernet24
description PCs
no shutdown
switchport access vlan 100
switchport mode access
switchport
spanning-tree portfast
spanning-tree bpdufilter enable
!
interface Ethernet51
no shutdown
channel-group 43 mode active
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,24 @@ interface Ethernet14
no shutdown
switchport
!
interface Ethernet47
description PCs
no shutdown
switchport access vlan 100
switchport mode access
switchport
spanning-tree portfast
spanning-tree bpdufilter enable
!
interface Ethernet48
description PCs
no shutdown
switchport access vlan 100
switchport mode access
switchport
spanning-tree portfast
spanning-tree bpdufilter enable
!
interface Ethernet51
shutdown
switchport
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,30 @@ ethernet_interfaces:
channel_group:
id: 43
mode: active
- name: Ethernet23
peer: PCs
peer_type: network_port
port_profile: pc
description: PCs
shutdown: false
switchport:
enabled: true
mode: access
access_vlan: 100
spanning_tree_portfast: edge
spanning_tree_bpdufilter: enabled
- name: Ethernet24
peer: PCs
peer_type: network_port
port_profile: pc
description: PCs
shutdown: false
switchport:
enabled: true
mode: access
access_vlan: 100
spanning_tree_portfast: edge
spanning_tree_bpdufilter: enabled
mlag_configuration:
domain_id: mlag
local_interface: Vlan4094
Expand All @@ -833,3 +857,5 @@ monitor_sessions:
destinations:
- Ethernet17
encapsulation_gre_metadata_tx: true
metadata:
platform: 720XPM-24Y6
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,30 @@ ethernet_interfaces:
shutdown: true
switchport:
enabled: true
- name: Ethernet47
peer: PCs
peer_type: network_port
port_profile: pc
description: PCs
shutdown: false
switchport:
enabled: true
mode: access
access_vlan: 100
spanning_tree_portfast: edge
spanning_tree_bpdufilter: enabled
- name: Ethernet48
peer: PCs
peer_type: network_port
port_profile: pc
description: PCs
shutdown: false
switchport:
enabled: true
mode: access
access_vlan: 100
spanning_tree_portfast: edge
spanning_tree_bpdufilter: enabled
mlag_configuration:
domain_id: mlag
local_interface: Vlan4094
Expand All @@ -760,3 +784,5 @@ mlag_configuration:
reload_delay_non_mlag: '330'
ip_igmp_snooping:
globally_enabled: true
metadata:
platform: 720XPM-48Y6
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,27 @@ network_ports:
channel_id: 43
mode: "active"

# The next two switches are targeted using a like regex filtering on correct
# platform type
- switches:
- network-ports-tests.*
switch_ports:
- Ethernet47-48 # Fix ports
platforms:
- 720XPM-48Y6
profile: pc
endpoint: PCs

- switches:
- network-ports-tests.*
switch_ports:
- Ethernet23-24 # Fix ports
platforms:
- 720XPM-24Y6
profile: pc
endpoint: PCs


servers:
- name: CONNECTED_ENDPOINT_OVERWRITING_NETWORK_PORT
adapters:
Expand Down Expand Up @@ -171,7 +192,22 @@ l2leaf:
nodes:
- name: network-ports-tests.1
id: 1
platform: 720XPM-48Y6
- name: network-ports-tests-2
filter:
only_vlans_in_use: true
id: 2
platform: 720XPM-24Y6

custom_platform_settings:
- platforms:
- 720XPM-48Y6
- 720XPM-24Y6
feature_support:
poe: true
queue_monitor_length_notify: false
reload_delay:
mlag: 300
non_mlag: 330
trident_forwarding_table_partition: flexible exact-match 16000 l2-shared 18000 l3-shared
22000

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions python-avd/pyavd/_eos_designs/schema/__init__.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ keys:
The regular expression must match the full hostname.
items:
type: str
#TODO: Update for review
platforms:
type: list
description: |
Match on platform type, you may need to create a custom platform in platform_settings.
items:
type: str
switch_ports:
type: list
description: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ def _filtered_network_ports(self: AvdStructuredConfigConnectedEndpoints) -> list
network_port_settings = self.shared_utils.get_merged_adapter_settings(network_port)
if not self._match_regexes(network_port_settings.switches, self.shared_utils.hostname):
continue
# TODO: Review
if network_port_settings.platforms and not self.shared_utils.platform in network_port_settings.platforms:
continue

filtered_network_ports.append(network_port_settings)

Expand Down

0 comments on commit 6d26f6e

Please sign in to comment.