diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/stun.md b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/stun.md new file mode 100644 index 00000000000..178c6b7a523 --- /dev/null +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/stun.md @@ -0,0 +1,69 @@ +# stun + +## Table of Contents + +- [Management](#management) + - [Management Interfaces](#management-interfaces) +- [STUN](#stun) + - [STUN Client](#stun-client) + - [STUN Server](#stun-server) + - [STUN Device Configuration](#stun-device-configuration) + +## Management + +### Management Interfaces + +#### Management Interfaces Summary + +##### IPv4 + +| Management Interface | description | Type | VRF | IP Address | Gateway | +| -------------------- | ----------- | ---- | --- | ---------- | ------- | +| Management1 | oob_management | oob | MGMT | 10.73.255.122/24 | 10.73.255.2 | + +##### IPv6 + +| Management Interface | description | Type | VRF | IPv6 Address | IPv6 Gateway | +| -------------------- | ----------- | ---- | --- | ------------ | ------------ | +| Management1 | oob_management | oob | MGMT | - | - | + +#### Management Interfaces Device Configuration + +```eos +! +interface Management1 + description oob_management + vrf MGMT + ip address 10.73.255.122/24 +``` + +## STUN + +### STUN Client + +#### Server Profiles + +| Server Profile | IP address | +| -------------- | ---------- | +| server1 | 1.2.3.4 | +| server2 | 2.3.4.5 | + +### STUN Server + +| Server local interface | +| ---------------------- | +| ethernet1 | + +### STUN Device Configuration + +```eos +! +stun + client + server-profile server1 + ip address 1.2.3.4 + server-profile server2 + ip address 2.3.4.5 + server + local-interface ethernet1 +``` diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/stun.cfg b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/stun.cfg new file mode 100644 index 00000000000..5a7744100e1 --- /dev/null +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/stun.cfg @@ -0,0 +1,24 @@ +!RANCID-CONTENT-TYPE: arista +! +transceiver qsfp default-mode 4x10G +! +hostname stun +! +no enable password +no aaa root +! +interface Management1 + description oob_management + vrf MGMT + ip address 10.73.255.122/24 +! +stun + client + server-profile server1 + ip address 1.2.3.4 + server-profile server2 + ip address 2.3.4.5 + server + local-interface ethernet1 +! +end diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/stun.yml b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/stun.yml new file mode 100644 index 00000000000..1d22f1840d0 --- /dev/null +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/stun.yml @@ -0,0 +1,12 @@ +### stun +--- +stun: + server: + local_interface: ethernet1 + client: + server_profiles: + # The servers are on purpose not in order in order to test the sorting + - name: server2 + ip_address: 2.3.4.5 + - name: server1 + ip_address: 1.2.3.4 diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/hosts.ini b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/hosts.ini index 025511c3f09..71be958b932 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/hosts.ini +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/hosts.ini @@ -137,6 +137,7 @@ spanning-tree-bpdu spanning-tree-rstp spanning-tree-rapid-pvst switchport-mode +stun system-control-plane tcam-profile static-routes diff --git a/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/stun.md b/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/stun.md new file mode 100644 index 00000000000..6d7c59197a6 --- /dev/null +++ b/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/stun.md @@ -0,0 +1,28 @@ + +=== "Table" + + | Variable | Type | Required | Default | Value Restrictions | Description | + | -------- | ---- | -------- | ------- | ------------------ | ----------- | + | [stun](## "stun") | Dictionary | | | | STUN configuration | + | [  client](## "stun.client") | Dictionary | | | | STUN client settings | + | [    server_profiles](## "stun.client.server_profiles") | List, items: Dictionary | | | | List of server profiles for the client | + | [      - name](## "stun.client.server_profiles.[].name") | String | Required, Unique | | | | + | [        ip_address](## "stun.client.server_profiles.[].ip_address") | String | | | | | + | [  server](## "stun.server") | Dictionary | | | | STUN server settings | + | [    local_interface](## "stun.server.local_interface") | String | | | | | + +=== "YAML" + + ```yaml + stun: + client: + server_profiles: + - name: + ip_address: + server: + local_interface: + ``` diff --git a/ansible_collections/arista/avd/roles/eos_cli_config_gen/schemas/eos_cli_config_gen.jsonschema.json b/ansible_collections/arista/avd/roles/eos_cli_config_gen/schemas/eos_cli_config_gen.jsonschema.json index da027171d55..c6f8315e1b5 100644 --- a/ansible_collections/arista/avd/roles/eos_cli_config_gen/schemas/eos_cli_config_gen.jsonschema.json +++ b/ansible_collections/arista/avd/roles/eos_cli_config_gen/schemas/eos_cli_config_gen.jsonschema.json @@ -19138,6 +19138,68 @@ }, "title": "Static Routes" }, + "stun": { + "type": "object", + "description": "STUN configuration", + "properties": { + "client": { + "type": "object", + "description": "STUN client settings", + "properties": { + "server_profiles": { + "type": "array", + "description": "List of server profiles for the client", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "title": "Name" + }, + "ip_address": { + "type": "string", + "title": "IP Address" + } + }, + "additionalProperties": false, + "patternProperties": { + "^_.+$": {} + }, + "required": [ + "name" + ] + }, + "title": "Server Profiles" + } + }, + "additionalProperties": false, + "patternProperties": { + "^_.+$": {} + }, + "title": "Client" + }, + "server": { + "type": "object", + "description": "STUN server settings", + "properties": { + "local_interface": { + "type": "string", + "title": "Local Interface" + } + }, + "additionalProperties": false, + "patternProperties": { + "^_.+$": {} + }, + "title": "Server" + } + }, + "additionalProperties": false, + "patternProperties": { + "^_.+$": {} + }, + "title": "Stun" + }, "switchport_default": { "type": "object", "properties": { diff --git a/ansible_collections/arista/avd/roles/eos_cli_config_gen/schemas/eos_cli_config_gen.schema.yml b/ansible_collections/arista/avd/roles/eos_cli_config_gen/schemas/eos_cli_config_gen.schema.yml index 6ba0f20092e..e6c0abcb83e 100644 --- a/ansible_collections/arista/avd/roles/eos_cli_config_gen/schemas/eos_cli_config_gen.schema.yml +++ b/ansible_collections/arista/avd/roles/eos_cli_config_gen/schemas/eos_cli_config_gen.schema.yml @@ -11231,6 +11231,31 @@ keys: - str min: 0 max: 4294967295 + stun: + type: dict + description: STUN configuration + keys: + client: + type: dict + description: STUN client settings + keys: + server_profiles: + type: list + description: List of server profiles for the client + primary_key: name + items: + type: dict + keys: + name: + type: str + ip_address: + type: str + server: + type: dict + description: STUN server settings + keys: + local_interface: + type: str switchport_default: type: dict keys: diff --git a/ansible_collections/arista/avd/roles/eos_cli_config_gen/schemas/schema_fragments/stun.schema.yml b/ansible_collections/arista/avd/roles/eos_cli_config_gen/schemas/schema_fragments/stun.schema.yml new file mode 100644 index 00000000000..7dcde871ad8 --- /dev/null +++ b/ansible_collections/arista/avd/roles/eos_cli_config_gen/schemas/schema_fragments/stun.schema.yml @@ -0,0 +1,33 @@ +# Copyright (c) 2023 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=../../../../plugins/plugin_utils/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: + stun: + type: dict + description: STUN configuration + keys: + client: + type: dict + description: STUN client settings + keys: + server_profiles: + type: list + description: List of server profiles for the client + primary_key: name + items: + type: dict + keys: + name: + type: str + ip_address: + type: str + server: + type: dict + description: STUN server settings + keys: + local_interface: + type: str diff --git a/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/documentation/stun.j2 b/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/documentation/stun.j2 new file mode 100644 index 00000000000..8cbf1d4f631 --- /dev/null +++ b/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/documentation/stun.j2 @@ -0,0 +1,40 @@ +{# + Copyright (c) 2023 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 - stun #} +{% if stun is arista.avd.defined %} + +## STUN +{% if stun.client is arista.avd.defined %} + +### STUN Client +{% if stun.client.server_profiles is arista.avd.defined %} + +#### Server Profiles + +| Server Profile | IP address | +| -------------- | ---------- | +{% for server_profile in stun.client.server_profiles | arista.avd.natural_sort('name') %} +| {{ server_profile.name }} | {{ server_profile.ip_address }} | +{% endfor %} +{% endif %} +{% endif %} +{% if stun.server is arista.avd.defined %} + +### STUN Server + +| Server local interface | +| ---------------------- | +{% if stun.server.local_interface is arista.avd.defined %} +| {{ stun.server.local_interface }} | +{% endif %} +{% endif %} + +### STUN Device Configuration + +```eos +{% include 'eos/stun.j2' %} +``` +{% endif %} diff --git a/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/eos-device-documentation.j2 b/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/eos-device-documentation.j2 index 0a977631ad5..b86759b01e1 100644 --- a/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/eos-device-documentation.j2 +++ b/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/eos-device-documentation.j2 @@ -95,6 +95,8 @@ {% include 'documentation/quality-of-service.j2' %} {# Priority Flow Control #} {% include 'documentation/priority-flow-control.j2' %} +{# STUN #} +{% include 'documentation/stun.j2' %} {# Maintenance Mode #} {% include 'documentation/maintenance-mode.j2' %} {# EOS CLI #} diff --git a/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/eos-intended-config.j2 b/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/eos-intended-config.j2 index ddf2d4babef..34a458187e4 100644 --- a/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/eos-intended-config.j2 +++ b/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/eos-intended-config.j2 @@ -295,6 +295,8 @@ {% include 'eos/management-api-models.j2' %} {# management security #} {% include 'eos/management-security.j2' %} +{# stun #} +{% include 'eos/stun.j2' %} {# 802.1x Global #} {% include 'eos/dot1x.j2' %} {# management ssh #} diff --git a/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/eos/stun.j2 b/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/eos/stun.j2 new file mode 100644 index 00000000000..8aef5f7d3d5 --- /dev/null +++ b/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/eos/stun.j2 @@ -0,0 +1,25 @@ +{# + Copyright (c) 2023 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 - stun #} +{% if stun is arista.avd.defined %} +! +stun +{% if stun.client is arista.avd.defined %} + client +{% for profile in stun.client.server_profiles | arista.avd.natural_sort('name') %} + server-profile {{ profile.name }} +{% if profile.ip_address is arista.avd.defined %} + ip address {{ profile.ip_address }} +{% endif %} +{% endfor %} +{% endif %} +{% if stun.server is arista.avd.defined %} + server +{% if stun.server.local_interface is arista.avd.defined %} + local-interface {{ stun.server.local_interface }} +{% endif %} +{% endif %} +{% endif %}