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): Add support for ip name server groups #4763

Open
wants to merge 24 commits into
base: devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
8df912a
Feat(eos_cli_config_gen): Add support for ip name server groups
Nov 26, 2024
40c190f
add default:default
Nov 27, 2024
7bb225b
Fixing the sequence of commands
Nov 30, 2024
a9d9178
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 2, 2024
3c9861e
update tests
Dec 2, 2024
e5f8096
Minor change in input
Dec 3, 2024
e08f5ca
Remove priority 0 if it priority is undefined
Dec 5, 2024
df8fa74
Minor fix
Dec 5, 2024
de0f95c
Update doc template
Dec 9, 2024
8bac26c
Rewording a condition in template
Dec 10, 2024
50f506e
Address comments
Dec 10, 2024
fa2b1e6
minor change in template and inputs
Dec 10, 2024
9ac87af
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 2, 2025
81bdf98
Make ip address primary key and allow duplicate
Jan 2, 2025
6b59756
Merge branch 'devel' into feat/eos_cli/ip-name-server-group
gmuloc Jan 2, 2025
d4704bf
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 2, 2025
20090f1
Making vrf required and update the template
Jan 10, 2025
c682e5c
Added todo
Jan 10, 2025
ab5a379
Merge branch 'devel' into feat/eos_cli/ip-name-server-group
laxmikantchintakindi Jan 10, 2025
9062122
update todo comment
Jan 10, 2025
344be67
Update eos template
Jan 13, 2025
a83e342
Merge branch 'devel' into feat/eos_cli/ip-name-server-group
MaheshGSLAB Jan 13, 2025
eef11b1
Merge branch 'devel' into feat/eos_cli/ip-name-server-group
Vibhu-gslab Jan 13, 2025
507fe1a
Merge branch 'devel' into feat/eos_cli/ip-name-server-group
laxmikantchintakindi Jan 17, 2025
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
Expand Up @@ -9,6 +9,7 @@
- [DNS Domain](#dns-domain)
- [IP Domain-list](#ip-domain-list)
- [IP Name Servers](#ip-name-servers)
- [IP Name Server Groups](#ip-name-server-groups)
- [Domain Lookup](#domain-lookup)
- [Clock Settings](#clock-settings)
- [NTP](#ntp)
Expand Down Expand Up @@ -421,6 +422,62 @@ ip name-server 2001:db8::2 priority 0
ip name-server vrf TEST 2001:db8::2 priority 3
```

### IP Name Server Groups

#### IP Name Server Groups Summary

##### mynameserver0

| IP Address | VRF | Priority |
| ---------- | --- | -------- |
| 1.1.1.1 | default | - |
| 2.2.2.2 | default | 1 |
| 8.8.8.8 | default | - |

##### mynameserver1

DNS Domain : arista.avd.com

IP Domain List : domain-list1

| IP Address | VRF | Priority |
| ---------- | --- | -------- |
| 1.1.1.1 | default | - |
| 2.2.2.1 | vrf1 | - |
| 2.2.2.2 | vrf1 | 1 |
| 2.2.2.4 | vrf1 | 4 |
| 2.2.2.6 | b_vrf | 3 |
| 2.2.2.7 | a_vrf | 3 |
| 8.8.8.8 | vrf1 | - |

##### mynameserver2

DNS Domain : anta.avd.com

#### IP Name Server Groups Device Configuration

```eos
!
ip name-server group mynameserver0
name-server vrf default 1.1.1.1
name-server vrf default 8.8.8.8
name-server vrf default 2.2.2.2 priority 1
!
ip name-server group mynameserver1
name-server vrf default 1.1.1.1
name-server vrf vrf1 2.2.2.1
name-server vrf vrf1 8.8.8.8
name-server vrf vrf1 2.2.2.2 priority 1
name-server vrf a_vrf 2.2.2.7 priority 3
name-server vrf b_vrf 2.2.2.6 priority 3
name-server vrf vrf1 2.2.2.4 priority 4
dns domain arista.avd.com
ip domain-list domain-list1
!
ip name-server group mynameserver2
dns domain anta.avd.com
```

### Domain Lookup

#### DNS Domain Lookup Summary
Expand Down Expand Up @@ -2828,6 +2885,10 @@ monitor server radius
| Name | Interfaces |
| ---- | ---------- |

##### Name-server

Name-server Group: mynameserver1

### Monitor Connectivity Device Configuration

```eos
Expand Down Expand Up @@ -2869,6 +2930,7 @@ monitor connectivity
url https://server2.local.com
!
vrf yellow
name-server group mynameserver1
interval 5
no shutdown
interface set GLOBAL_SET Ethernet1-4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,25 @@ monitor server radius
probe threshold failure 100
probe method access-request username arista password 7 141600021F102B
!
ip name-server group mynameserver0
Vibhu-gslab marked this conversation as resolved.
Show resolved Hide resolved
name-server vrf default 1.1.1.1
name-server vrf default 8.8.8.8
name-server vrf default 2.2.2.2 priority 1
!
ip name-server group mynameserver1
name-server vrf default 1.1.1.1
name-server vrf vrf1 2.2.2.1
name-server vrf vrf1 8.8.8.8
name-server vrf vrf1 2.2.2.2 priority 1
name-server vrf a_vrf 2.2.2.7 priority 3
name-server vrf b_vrf 2.2.2.6 priority 3
name-server vrf vrf1 2.2.2.4 priority 4
dns domain arista.avd.com
ip domain-list domain-list1
!
ip name-server group mynameserver2
dns domain anta.avd.com
!
platform trident mmu queue profile mc_example_profile
egress unicast queue 1 reserved bytes 0
egress unicast queue 2 reserved cells 0
Expand Down Expand Up @@ -3967,6 +3986,7 @@ monitor connectivity
url https://server2.local.com
!
vrf yellow
name-server group mynameserver1
interval 5
no shutdown
interface set GLOBAL_SET Ethernet1-4
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
ip_name_server_groups:
- name: mynameserver1
ip_domain_list: domain-list1
dns_domain: arista.avd.com
name_servers:
- ip_address: 8.8.8.8
vrf: vrf1
- ip_address: 1.1.1.1
vrf: default
- ip_address: 2.2.2.2
vrf: vrf1
priority: 1
- ip_address: 2.2.2.1
vrf: vrf1
- ip_address: 2.2.2.4
vrf: vrf1
priority: 4
- ip_address: 2.2.2.6
vrf: b_vrf
priority: 3
- ip_address: 2.2.2.7
vrf: a_vrf
priority: 3

- name: mynameserver0
name_servers:
- ip_address: 8.8.8.8
vrf: default
- ip_address: 1.1.1.1
vrf: default
- ip_address: 2.2.2.2
vrf: default
priority: 1

- name: mynameserver2
dns_domain: anta.avd.com
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ monitor_connectivity:
- name: HOST_SET
interfaces: Loopback2-4, Loopback10-12
local_interfaces: GLOBAL_SET
name_server_group: mynameserver1
hosts:
- name: server1
description: server1_connectivity_monitor
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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,38 @@
{#
Copyright (c) 2023-2025 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 - ip name server groups #}
{% if ip_name_server_groups is arista.avd.defined %}

### IP Name Server Groups

#### IP Name Server Groups Summary
{% for group in ip_name_server_groups | arista.avd.natural_sort("name") %}

##### {{ group.name }}
{% if group.dns_domain is arista.avd.defined %}

DNS Domain : {{ group.dns_domain }}
{% endif %}
{% if group.ip_domain_list is arista.avd.defined %}

IP Domain List : {{ group.ip_domain_list }}
{% endif %}
{% if group.name_servers is arista.avd.defined %}

| IP Address | VRF | Priority |
| ---------- | --- | -------- |
{% for server in group.name_servers | arista.avd.natural_sort("ip_address") %}
| {{ server.ip_address }} | {{ server.vrf }} | {{ server.priority | arista.avd.default('-') }} |
{% endfor %}
{% endif %}
{% endfor %}

#### IP Name Server Groups Device Configuration

```eos
{% include 'eos/ip-name-server-groups.j2' %}
```
{% endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
{% include 'documentation/domain-list.j2' %}
{## IP Name Servers #}
{% include 'documentation/ip-name-servers.j2' %}
{## IP Name Server Group ##}
{% include 'documentation/ip-name-server-groups.j2' %}
{## Domain Lookup #}
{% include 'documentation/ip-domain-lookup.j2' %}
{## Clock #}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@
{% endif %}
{% endfor %}
{% endif %}
{% if monitor_connectivity.name_server_group is arista.avd.defined %}

##### Name-server

Name-server Group: {{ monitor_connectivity.name_server_group }}
{% endif %}

### Monitor Connectivity Device Configuration

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@
{% include 'eos/mcs-client.j2' %}
{# monitor server radius #}
{% include 'eos/monitor-server-radius.j2' %}
{# ip name-server groups #}
{% include 'eos/ip-name-server-groups.j2' %}
{# platform - trident#}
{% include 'eos/platform-trident.j2' %}
{# IP NAT - Part 1#}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{#
Copyright (c) 2023-2025 Arista Networks, Inc.
Use of this source code is governed by the Apache License 2.0
that can be found in the LICENSE file.
#}
{% for name_server_group in ip_name_server_groups | arista.avd.natural_sort("name") %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add a documentation templates for ip name-server groups listing the servers inside

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added.

!
ip name-server group {{ name_server_group.name }}
{% set all_name_servers = [] %}
{% for server in name_server_group.name_servers | arista.avd.default([]) %}
{% set name_server = {} %}
{% if server.priority is not arista.avd.defined %}
{% do name_server.setdefault('priority', 0) %}
{% endif %}
{% do name_server.update(server) %}
{% do all_name_servers.append(name_server) %}
{% endfor %}
{% for server in all_name_servers | arista.avd.natural_sort("ip_address") | arista.avd.natural_sort("vrf") | arista.avd.natural_sort("priority") %}
{% if server.priority != 0 %}
{% set name_server_cli = "name-server vrf " ~ server["vrf"] ~ " " ~ server["ip_address"] ~ " priority " ~ server["priority"] %}
{% else %}
{% set name_server_cli = "name-server vrf " ~ server["vrf"] ~ " " ~ server["ip_address"] %}
{% endif %}
{{ name_server_cli }}
{% endfor %}
{% if name_server_group.dns_domain is arista.avd.defined %}
dns domain {{ name_server_group.dns_domain }}
{% endif %}
{% if name_server_group.ip_domain_list is arista.avd.defined %}
ip domain-list {{ name_server_group.ip_domain_list }}
{% endif %}
{% endfor %}
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ monitor connectivity
{% endfor %}
{% endif %}
{% endfor %}
{% if monitor_connectivity.name_server_group is arista.avd.defined %}
name-server group {{ monitor_connectivity.name_server_group }}
{% endif %}
{% if monitor_connectivity.interval is arista.avd.defined %}
interval {{ monitor_connectivity.interval }}
{% endif %}
Expand Down
Loading
Loading