Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat(eos_cli_config_gen): Support STUN #3147

Merged
merged 27 commits into from
Sep 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
463e6a5
Adding stun
burnyd Sep 18, 2023
017ea5c
Slight change to add stun to docs
burnyd Sep 18, 2023
165b232
Fixed linting
burnyd Sep 18, 2023
cbf224b
retrying tests
burnyd Sep 18, 2023
826e607
Fix: Use fqdn for defined test
gmuloc Sep 19, 2023
ad770db
Update ansible_collections/arista/avd/roles/eos_cli_config_gen/templa…
burnyd Sep 19, 2023
a5fd00d
fixed linting issues
burnyd Sep 19, 2023
1a4ad23
Fix trailing spaces
burnyd Sep 19, 2023
1617fc7
molecule tests fix
burnyd Sep 19, 2023
cf03af7
Fix stun for molecule testing
burnyd Sep 19, 2023
e29124d
Update ansible_collections/arista/avd/molecule/eos_cli_config_gen/inv…
burnyd Sep 20, 2023
00e7417
Update ansible_collections/arista/avd/roles/eos_cli_config_gen/templa…
burnyd Sep 20, 2023
f4dbf46
Update ansible_collections/arista/avd/roles/eos_cli_config_gen/templa…
burnyd Sep 20, 2023
b79f315
resolving issues
burnyd Sep 20, 2023
12b7e3a
Fix(eos_cli_config_gen): Properly renders IP addresses for stun clien…
gmuloc Sep 20, 2023
7b1824f
Fix(eos_cli_config_gen): Typo in CLI for server-profiles
gmuloc Sep 20, 2023
89f46d4
Merge branch 'devel' into stun
gmuloc Sep 20, 2023
7f4fd24
Update ansible_collections/arista/avd/roles/eos_cli_config_gen/templa…
burnyd Sep 22, 2023
3d32e38
Update ansible_collections/arista/avd/roles/eos_cli_config_gen/templa…
burnyd Sep 22, 2023
bcf1733
Update ansible_collections/arista/avd/roles/eos_cli_config_gen/templa…
burnyd Sep 22, 2023
626d3f6
Made changes to schema
burnyd Sep 22, 2023
da8d101
Apply suggestions from code review
gmuloc Sep 25, 2023
1e3ad5b
Fix(eos_cli_config_gen): Sort stun.client.server_profiles
gmuloc Sep 27, 2023
aefdb64
Doc: Rewording documentation
gmuloc Sep 29, 2023
704b7a5
Apply suggestions from code review
ClausHolbechArista Sep 29, 2023
dbb70c9
Apply suggestions from code review
ClausHolbechArista Sep 29, 2023
7429f58
Update ansible_collections/arista/avd/roles/eos_cli_config_gen/templa…
ClausHolbechArista Sep 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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
ClausHolbechArista marked this conversation as resolved.
Show resolved Hide resolved
client
server-profile server1
ip address 1.2.3.4
server-profile server2
ip address 2.3.4.5
server
local-interface ethernet1
```
Original file line number Diff line number Diff line change
@@ -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
ClausHolbechArista marked this conversation as resolved.
Show resolved Hide resolved
client
server-profile server1
ip address 1.2.3.4
server-profile server2
ip address 2.3.4.5
server
local-interface ethernet1
!
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
### stun
burnyd marked this conversation as resolved.
Show resolved Hide resolved
---
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
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ spanning-tree-bpdu
spanning-tree-rstp
spanning-tree-rapid-pvst
switchport-mode
stun
system-control-plane
tcam-profile
static-routes
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!--
~ 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.
-->
=== "Table"

| Variable | Type | Required | Default | Value Restrictions | Description |
| -------- | ---- | -------- | ------- | ------------------ | ----------- |
| [<samp>stun</samp>](## "stun") | Dictionary | | | | STUN configuration |
| [<samp>&nbsp;&nbsp;client</samp>](## "stun.client") | Dictionary | | | | STUN client settings |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;server_profiles</samp>](## "stun.client.server_profiles") | List, items: Dictionary | | | | List of server profiles for the client |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- name</samp>](## "stun.client.server_profiles.[].name") | String | Required, Unique | | | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ip_address</samp>](## "stun.client.server_profiles.[].ip_address") | String | | | | |
| [<samp>&nbsp;&nbsp;server</samp>](## "stun.server") | Dictionary | | | | STUN server settings |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;local_interface</samp>](## "stun.server.local_interface") | String | | | | |

=== "YAML"

```yaml
stun:
client:
server_profiles:
- name: <str>
ip_address: <str>
server:
local_interface: <str>
```
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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:
ClausHolbechArista marked this conversation as resolved.
Show resolved Hide resolved
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
gmuloc marked this conversation as resolved.
Show resolved Hide resolved
server:
type: dict
description: STUN server settings
keys:
local_interface:
type: str
Original file line number Diff line number Diff line change
@@ -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 %}
Original file line number Diff line number Diff line change
Expand Up @@ -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 #}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 #}
Expand Down
Original file line number Diff line number Diff line change
@@ -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
ClausHolbechArista marked this conversation as resolved.
Show resolved Hide resolved
{% 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 %}