Skip to content

Commit

Permalink
added eos_cli_config_gen recirc_interfaces model and templates
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanmusser committed Oct 4, 2024
1 parent cb144b5 commit dbee146
Show file tree
Hide file tree
Showing 8 changed files with 146 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<--
Expand Down

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 @@ -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 #}
Expand Down
Original file line number Diff line number Diff line change
@@ -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 %}
Original file line number Diff line number Diff line change
Expand Up @@ -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 #}
Expand Down
Original file line number Diff line number Diff line change
@@ -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 %}

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
@@ -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."

0 comments on commit dbee146

Please sign in to comment.