Skip to content

Commit 277cd34

Browse files
MaheshGSLABgmulocClausHolbechArista
authored
Feat(eos_cli_config_gen): Added Support for Spanning Tree Port ID Allocation (#5286)
Co-authored-by: Guillaume Mulocher <[email protected]> Co-authored-by: Claus Holbech <[email protected]>
1 parent 51c7ba6 commit 277cd34

File tree

9 files changed

+104
-0
lines changed

9 files changed

+104
-0
lines changed

ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host1.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3357,6 +3357,7 @@ STP mode: **rapid-pvst**
33573357
- Spanning Tree disabled for VLANs: **105,202,505-506**
33583358
- Global BPDU Guard for Edge ports is disabled.
33593359
- Global BPDU Filter for Edge ports is disabled.
3360+
- Range of port-ids reserved for port-channels: 201-2001.
33603361

33613362
### Spanning Tree Device Configuration
33623363

@@ -3368,6 +3369,7 @@ no spanning-tree edge-port bpduguard default
33683369
no spanning-tree edge-port bpdufilter default
33693370
spanning-tree bpduguard rate-limit default
33703371
spanning-tree bpduguard rate-limit count 100
3372+
spanning-tree port-id allocation port-channel range 201 2001
33713373
spanning-tree vlan-id 1,2,3,4,5,10-15 priority 4096
33723374
spanning-tree vlan-id 3 priority 8192
33733375
spanning-tree vlan-id 100-500 priority 16384

ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/host1.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,6 +1129,7 @@ no spanning-tree edge-port bpduguard default
11291129
no spanning-tree edge-port bpdufilter default
11301130
spanning-tree bpduguard rate-limit default
11311131
spanning-tree bpduguard rate-limit count 100
1132+
spanning-tree port-id allocation port-channel range 201 2001
11321133
spanning-tree vlan-id 1,2,3,4,5,10-15 priority 4096
11331134
spanning-tree vlan-id 3 priority 8192
11341135
spanning-tree vlan-id 100-500 priority 16384

ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/spanning-tree.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ spanning_tree:
1717
- id: "100-500"
1818
priority: 16384
1919
no_spanning_tree_vlan: 105,202,505-506
20+
port_id_allocation_port_channel_range:
21+
minimum: 201
22+
maximum: 2001

ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/spanning-tree.md

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/spanning-tree.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ STP Root Super: **{{ spanning_tree.root_super }}**
8181
{% endif %}
8282
{% endif %}
8383
{% endif %}
84+
{% if spanning_tree.port_id_allocation_port_channel_range is arista.avd.defined %}
85+
{% set min_range = spanning_tree.port_id_allocation_port_channel_range.minimum %}
86+
{% set max_range = spanning_tree.port_id_allocation_port_channel_range.maximum %}
87+
{% do global_settings.append("- Range of port-ids reserved for port-channels: " ~ min_range ~ "-" ~ max_range ~ ".") %}
88+
{% endif %}
8489
{% if global_settings | length > 0 %}
8590

8691
#### Global Spanning-Tree Settings

python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/spanning-tree.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ spanning-tree bpduguard rate-limit count {{ spanning_tree.bpduguard_rate_limit.c
3838
{% if spanning_tree.root_super is arista.avd.defined(true) %}
3939
spanning-tree root super
4040
{% endif %}
41+
{% if spanning_tree.port_id_allocation_port_channel_range is arista.avd.defined %}
42+
{% set min_range = spanning_tree.port_id_allocation_port_channel_range.minimum %}
43+
{% set max_range = spanning_tree.port_id_allocation_port_channel_range.maximum %}
44+
spanning-tree port-id allocation port-channel range {{ min_range }} {{ max_range }}
45+
{% endif %}
4146
{% if spanning_tree.mode is arista.avd.defined('mstp') %}
4247
{% for mst_instance in spanning_tree.mst_instances | arista.avd.natural_sort('id') %}
4348
{% if mst_instance.priority is arista.avd.defined %}

python-avd/pyavd/_eos_cli_config_gen/schema/__init__.py

Lines changed: 36 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/spanning_tree.schema.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,23 @@ keys:
107107
type: int
108108
convert_types:
109109
- str
110+
port_id_allocation_port_channel_range:
111+
description: Specify range of port-ids to reserve for port-channels.
112+
type: dict
113+
keys:
114+
minimum:
115+
description: Specify minimum value for reserved range.
116+
type: int
117+
min: 1
118+
max: 2048
119+
required: true
120+
convert_types:
121+
- str
122+
maximum:
123+
description: Specify maximum value for reserved range.
124+
type: int
125+
min: 1
126+
max: 2048
127+
required: true
128+
convert_types:
129+
- str

0 commit comments

Comments
 (0)