2023-12-18 10:22:14 +00:00
|
|
|
# https://docs.nvidia.com/networking-ethernet-software/cumulus-linux/Layer-1-and-Switch-Ports/Interface-Configuration-and-Management/Switch-Port-Attributes/#breakout-ports
|
2024-05-13 15:44:39 +00:00
|
|
|
{% for interface in interfaces | selectattr('name', 'match', '^swp[0-9]+(s0)?$') %}
|
|
|
|
{# get '1' from 'swp1' and '2' from 'swp2s0' #}
|
|
|
|
{% set port = interface.name | regex_replace('^swp([0-9]+).*$', '\\1') %}
|
|
|
|
{% set count = interfaces | selectattr('name', 'match', '^swp'+port+'(s[0-9])*$') | length %}
|
|
|
|
{{ port }}={% if interface.enabled or count > 1 %}{{ count }}x{% else %}disabled{% endif +%}
|
2023-12-18 10:22:14 +00:00
|
|
|
{% endfor %}
|