diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/network-ports-tests-2.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/network-ports-tests-2.cfg
index c8a739cc50e..6b85975b97a 100644
--- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/network-ports-tests-2.cfg
+++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/network-ports-tests-2.cfg
@@ -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
diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/network-ports-tests.1.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/network-ports-tests.1.cfg
index 66d60064716..a0044036aa1 100644
--- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/network-ports-tests.1.cfg
+++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/network-ports-tests.1.cfg
@@ -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
diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/network-ports-tests-2.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/network-ports-tests-2.yml
index 7459a80d68f..cc820a07cdc 100644
--- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/network-ports-tests-2.yml
+++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/network-ports-tests-2.yml
@@ -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
@@ -833,3 +857,5 @@ monitor_sessions:
destinations:
- Ethernet17
encapsulation_gre_metadata_tx: true
+metadata:
+ platform: 720XPM-24Y6
diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/network-ports-tests.1.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/network-ports-tests.1.yml
index 4629462b53f..8ec8a7f62c0 100644
--- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/network-ports-tests.1.yml
+++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/network-ports-tests.1.yml
@@ -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
@@ -760,3 +784,5 @@ mlag_configuration:
reload_delay_non_mlag: '330'
ip_igmp_snooping:
globally_enabled: true
+metadata:
+ platform: 720XPM-48Y6
diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/NETWORK_PORTS_TESTS.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/NETWORK_PORTS_TESTS.yml
index 095e7996bea..aaed9118ab5 100644
--- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/NETWORK_PORTS_TESTS.yml
+++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/NETWORK_PORTS_TESTS.yml
@@ -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:
@@ -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
\ No newline at end of file
diff --git a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/network-ports.md b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/network-ports.md
index 355bf327783..a3fab294d08 100644
--- a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/network-ports.md
+++ b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/network-ports.md
@@ -10,6 +10,8 @@
| [network_ports](## "network_ports") | List, items: Dictionary | | | | |
| [ - switches](## "network_ports.[].switches") | List, items: String | | | | Regex matching the full hostname of one or more switches.
The regular expression must match the full hostname.
|
| [ - <str>](## "network_ports.[].switches.[]") | String | | | | |
+ | [ platforms](## "network_ports.[].platforms") | List, items: String | | | | Match on platform type
|
+ | [ - <str>](## "network_ports.[].platforms.[]") | String | | | | |
| [ switch_ports](## "network_ports.[].switch_ports") | List, items: String | | | | List of ranges using AVD range_expand syntax.
For example:
switch_ports:
- Ethernet1
- Ethernet2-48
All switch_ports ranges are expanded into individual port configurations.
For more details and examples of the `range_expand` syntax, see the [`arista.avd.range_expand` documentation](../../../docs/plugins/Filter_plugins/range_expand.md).
|
| [ - <str>](## "network_ports.[].switch_ports.[]") | String | | | | |
| [ description](## "network_ports.[].description") | String | | | | Description or description template to be used on all ports.
This can be a template using the AVD string formatter syntax: https://avd.arista.com/devel/roles/eos_designs/docs/how-to/custom-descriptions-names.html#avd-string-formatter-syntax.
The available template fields are:
- `endpoint_type` - always set to `network_port`.
- `endpoint` - content of the `endpoint` key if set.
- `port_channel_id`: The port-channel number for the switch.
The default description is set by `default_network_ports_description`.
By default the description is templated from the `endpoint` key if set. |
@@ -192,6 +194,10 @@
- switches:
-
+ # Match on platform type
+ platforms:
+ -
+
# List of ranges using AVD range_expand syntax.
# For example:
#
diff --git a/python-avd/pyavd/_eos_designs/schema/__init__.py b/python-avd/pyavd/_eos_designs/schema/__init__.py
index afa5548636b..1c71da501d5 100644
--- a/python-avd/pyavd/_eos_designs/schema/__init__.py
+++ b/python-avd/pyavd/_eos_designs/schema/__init__.py
@@ -6777,6 +6777,11 @@ class Switches(AvdList[str]):
Switches._item_type = str
+ class Platforms(AvdList[str]):
+ """Subclass of AvdList with `str` items."""
+
+ Platforms._item_type = str
+
class SwitchPorts(AvdList[str]):
"""Subclass of AvdList with `str` items."""
@@ -7940,6 +7945,7 @@ class StructuredConfig(EosCliConfigGen.EthernetInterfacesItem):
_fields: ClassVar[dict] = {
"switches": {"type": Switches},
+ "platforms": {"type": Platforms},
"switch_ports": {"type": SwitchPorts},
"description": {"type": str},
"endpoint": {"type": str},
@@ -7984,6 +7990,13 @@ class StructuredConfig(EosCliConfigGen.EthernetInterfacesItem):
hostname.
+ Subclass of AvdList with `str` items.
+ """
+ platforms: Platforms
+ """
+ Match on platform type
+
+
Subclass of AvdList with `str` items.
"""
switch_ports: SwitchPorts
@@ -8176,6 +8189,7 @@ def __init__(
self,
*,
switches: Switches | UndefinedType = Undefined,
+ platforms: Platforms | UndefinedType = Undefined,
switch_ports: SwitchPorts | UndefinedType = Undefined,
description: str | None | UndefinedType = Undefined,
endpoint: str | None | UndefinedType = Undefined,
@@ -8226,6 +8240,11 @@ def __init__(
hostname.
+ Subclass of AvdList with `str` items.
+ platforms:
+ Match on platform type
+
+
Subclass of AvdList with `str` items.
switch_ports:
List of ranges using AVD range_expand syntax.
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 b241f60331a..5cacf04478e 100644
--- a/python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml
+++ b/python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml
@@ -2291,6 +2291,13 @@ keys:
The regular expression must match the full hostname.
+ '
+ items:
+ type: str
+ platforms:
+ type: list
+ description: 'Match on platform type
+
'
items:
type: str
diff --git a/python-avd/pyavd/_eos_designs/schema/schema_fragments/network_ports.schema.yml b/python-avd/pyavd/_eos_designs/schema/schema_fragments/network_ports.schema.yml
index 3c1ce0ce1ed..7e173060c2f 100644
--- a/python-avd/pyavd/_eos_designs/schema/schema_fragments/network_ports.schema.yml
+++ b/python-avd/pyavd/_eos_designs/schema/schema_fragments/network_ports.schema.yml
@@ -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: |
diff --git a/python-avd/pyavd/_eos_designs/structured_config/connected_endpoints/utils.py b/python-avd/pyavd/_eos_designs/structured_config/connected_endpoints/utils.py
index 45251b79108..2b13bf82ca0 100644
--- a/python-avd/pyavd/_eos_designs/structured_config/connected_endpoints/utils.py
+++ b/python-avd/pyavd/_eos_designs/structured_config/connected_endpoints/utils.py
@@ -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)