diff --git a/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/input-variables.md b/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/input-variables.md index 6d8df9aa776..58624cbb683 100644 --- a/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/input-variables.md +++ b/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/input-variables.md @@ -279,6 +279,12 @@ roles/eos_cli_config_gen/docs/tables/traffic-policies.md ## Interfaces +### Recirculation interfaces + +--8<-- +roles/eos_cli_config_gen/docs/tables/recirc-interfaces.md +--8<-- + ### DPS interfaces --8<-- diff --git a/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/recirc-interfaces.md b/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/recirc-interfaces.md new file mode 100644 index 00000000000..cad42f107a9 --- /dev/null +++ b/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/recirc-interfaces.md @@ -0,0 +1,32 @@ + +=== "Table" + + | Variable | Type | Required | Default | Value Restrictions | Description | + | -------- | ---- | -------- | ------- | ------------------ | ----------- | + | [recirc_interfaces](## "recirc_interfaces") | List, items: Dictionary | | | | | + | [  - name](## "recirc_interfaces.[].name") | String | Required, Unique | | | Recirculation interface name. | + | [    description](## "recirc_interfaces.[].description") | String | | | | | + | [    shutdown](## "recirc_interfaces.[].shutdown") | Boolean | | | | | + | [    recirculation_features](## "recirc_interfaces.[].recirculation_features") | String | | | Valid Values:
- vxlan
- telemetry inband
- openflow
- cpu-mirror | Set the feature that will use this port for recirculation. | + | [    eos_cli](## "recirc_interfaces.[].eos_cli") | String | | | | Multiline String with EOS CLI rendered directly on the Dps interface in the final EOS configuration. | + +=== "YAML" + + ```yaml + recirc_interfaces: + + # Recirculation interface name. + - name: + description: + shutdown: + + # Set the feature that will use this port for recirculation. + recirculation_features: + + # Multiline String with EOS CLI rendered directly on the Dps interface in the final EOS configuration. + eos_cli: + ``` diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/interfaces.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/interfaces.j2 index fbd4b15a7ce..1486039ea77 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/interfaces.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/interfaces.j2 @@ -21,6 +21,8 @@ {% include 'documentation/interface-defaults.j2' %} {## Interface Profiles #} {% include 'documentation/interface-profiles.j2' %} +{## Recirculation Interfaces #} +{% include 'documentation/recirc-interfaces.j2' %} {## DPS Interfaces #} {% include 'documentation/dps-interfaces.j2' %} {## Ethernet Interfaces #} diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/recirc-interfaces.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/recirc-interfaces.j2 new file mode 100644 index 00000000000..4c1fbd02c31 --- /dev/null +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/recirc-interfaces.j2 @@ -0,0 +1,27 @@ +{# + Copyright (c) 2023-2024 Arista Networks, Inc. + Use of this source code is governed by the Apache License 2.0 + that can be found in the LICENSE file. +#} +{# doc - recirc interfaces #} +{% if recirc_interfaces is arista.avd.defined %} + +### Recirculation Interfaces + +#### Recirculation Interfaces Summary + +| Interface | Description | Shutdown | Recirc Features | +| --------- | ----------- | -------- | --------------- | +{% for recirc_interface in recirc_interfaces | arista.avd.natural_sort('name') %} +{% set description = recirc_interface.description | arista.avd.default("-") %} +{% set shutdown = recirc_interface.shutdown | arista.avd.default("-") %} +{% set recirculation_features = recirc_interface.recirculation_features | arista.avd.default("-") %} +| {{ recirc_interface.name }} | {{ description }} | {{ shutdown }} | {{ recirculation_features }} | +{% endfor %} + +#### Recirculation Interfaces Device Configuration + +```eos +{% include 'eos/recirc-interfaces.j2' %} +``` +{% endif %} diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos-intended-config.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos-intended-config.j2 index 931559827e9..ff04f238191 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos-intended-config.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos-intended-config.j2 @@ -192,6 +192,8 @@ {% include 'eos/mac-security.j2' %} {# Port-Channel Interfaces #} {% include 'eos/port-channel-interfaces.j2' %} +{# Recirc Interfaces #} +{% include 'eos/recirc-interfaces.j2' %} {# DPS Interfaces #} {% include 'eos/dps-interfaces.j2' %} {# Ethernet Interfaces #} diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/recirc-interfaces.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/recirc-interfaces.j2 new file mode 100644 index 00000000000..f54c8213e5d --- /dev/null +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/recirc-interfaces.j2 @@ -0,0 +1,24 @@ +{# + Copyright (c) 2023-2024 Arista Networks, Inc. + Use of this source code is governed by the Apache License 2.0 + that can be found in the LICENSE file. +#} +{# eos - recirc interfaces #} +{% for recirc_interface in recirc_interfaces | arista.avd.natural_sort('name') %} +! +interface {{ recirc_interface.name }} +{% if recirc_interface.description is arista.avd.defined %} + description {{ recirc_interface.description }} +{% endif %} +{% if recirc_interface.shutdown is arista.avd.defined(true) %} + shutdown +{% elif recirc_interface.shutdown is arista.avd.defined(false) %} + no shutdown +{% endif %} +{% if recirc_interface.recirculation_features is arista.avd.defined %} + switchport recirculation features {{ recirc_interface.recirculation_features }} +{% endif %} +{% if recirc_interface.eos_cli is arista.avd.defined %} + {{ recirc_interface.eos_cli | indent(3, false) }} +{% endif %} +{% endfor %} diff --git a/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml b/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml index d5c3e7eaad6..60e8f6f011d 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml +++ b/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml @@ -11436,6 +11436,31 @@ keys: new_key: radius_server.hosts remove_in_version: v5.0.0 type: list + recirc_interfaces: + type: list + primary_key: name + items: + type: dict + keys: + name: + type: str + description: Recirculation interface name. + description: + type: str + shutdown: + type: bool + recirculation_features: + type: str + valid_values: + - vxlan + - telemetry inband + - openflow + - cpu-mirror + description: Set the feature that will use this port for recirculation. + eos_cli: + type: str + description: Multiline String with EOS CLI rendered directly on the Dps + interface in the final EOS configuration. redundancy: type: dict keys: diff --git a/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/recirc_interfaces.yml b/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/recirc_interfaces.yml new file mode 100644 index 00000000000..1f58a78775c --- /dev/null +++ b/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/recirc_interfaces.yml @@ -0,0 +1,28 @@ +# Copyright (c) 2023-2024 Arista Networks, Inc. +# Use of this source code is governed by the Apache License 2.0 +# that can be found in the LICENSE file. +# yaml-language-server: $schema=../../../_schema/avd_meta_schema.json +# Line above is used by RedHat's YAML Schema vscode extension +# Use Ctrl + Space to get suggestions for every field. Autocomplete will pop up after typing 2 letters. +type: dict +keys: + recirc_interfaces: + type: list + primary_key: name + items: + type: dict + keys: + name: + type: str + description: "Recirculation interface name." + description: + type: str + shutdown: + type: bool + recirculation_features: + type: str + valid_values: ["vxlan", "telemetry inband", "openflow", "cpu-mirror"] + description: "Set the feature that will use this port for recirculation." + eos_cli: + type: str + description: "Multiline String with EOS CLI rendered directly on the Dps interface in the final EOS configuration."