Skip to content

Commit

Permalink
Update the template and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Laxmikant Chintakindi authored and Laxmikant Chintakindi committed Dec 23, 2024
1 parent 6ac93b3 commit 6bda3c7
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -387,17 +387,21 @@ ip domain-list domain2.local
| 2001:db8::2 | - | 0 |
| 2001:db8::1 | mgmt | - |
| 2001:db8::2 | TEST | 3 |
| 2001:db8::1 | TEST | 3 |
| 10.10.128.11 | TEST | 2 |

#### IP Name Servers Device Configuration

```eos
ip name-server 10.10.128.10
ip name-server vrf default 10.10.128.10
ip name-server vrf default 10.10.129.10
ip name-server vrf default 2001:db8::1
ip name-server vrf default 2001:db8::2
ip name-server vrf mgmt 10.10.128.10
ip name-server vrf TEST 10.10.128.10 priority 3
ip name-server 10.10.129.10 priority 0
ip name-server 2001:db8::1
ip name-server vrf mgmt 2001:db8::1
ip name-server 2001:db8::2 priority 0
ip name-server vrf TEST 10.10.128.11 priority 2
ip name-server vrf TEST 10.10.128.10 priority 3
ip name-server vrf TEST 2001:db8::1 priority 3
ip name-server vrf TEST 2001:db8::2 priority 3
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -489,13 +489,15 @@ ip nat profile NAT-PROFILE-TEST-VRF vrf TEST
hostname hostname-set-via-hostname-var
ip domain lookup source-interface Loopback0
ip domain lookup vrf mgt source-interface Management0
ip name-server 10.10.128.10
ip name-server vrf default 10.10.128.10
ip name-server vrf default 10.10.129.10
ip name-server vrf default 2001:db8::1
ip name-server vrf default 2001:db8::2
ip name-server vrf mgmt 10.10.128.10
ip name-server vrf TEST 10.10.128.10 priority 3
ip name-server 10.10.129.10 priority 0
ip name-server 2001:db8::1
ip name-server vrf mgmt 2001:db8::1
ip name-server 2001:db8::2 priority 0
ip name-server vrf TEST 10.10.128.11 priority 2
ip name-server vrf TEST 10.10.128.10 priority 3
ip name-server vrf TEST 2001:db8::1 priority 3
ip name-server vrf TEST 2001:db8::2 priority 3
dns domain test.local
ip domain-list domain1.local
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,9 @@ ip_name_servers:
- ip_address: 2001:db8::2
vrf: TEST
priority: 3
- ip_address: 2001:db8::1
vrf: TEST
priority: 3
- ip_address: 10.10.128.11
vrf: TEST
priority: 2
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ transceiver qsfp default-mode 4x10G
service routing protocols model multi-agent
!
hostname custom-structured-configuration
ip name-server vrf MGMT 192.168.42.10
ip name-server vrf MGMT 192.168.42.40
ip name-server vrf MGMT 192.168.42.50
ip name-server vrf VRF1 192.168.42.1
ip name-server vrf VRF2 192.168.42.1
ip name-server vrf VRF1 192.168.42.4
ip name-server vrf VRF2 192.168.42.8
ip name-server vrf MGMT 192.168.42.10
ip name-server vrf VRF1 192.168.42.10
ip name-server vrf MGMT 192.168.42.40
ip name-server vrf VRF2 192.168.42.1
ip name-server vrf VRF2 192.168.42.8
ip name-server vrf VRF2 192.168.42.40
ip name-server vrf MGMT 192.168.42.50
!
vrf instance MGMT
!
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 @@ -4,14 +4,24 @@
that can be found in the LICENSE file.
#}
{# eos - ip name servers #}
{% for name_server in ip_name_servers | arista.avd.natural_sort('ip_address') %}
{% set name_server_cli = "ip name-server" %}
{% if name_server.vrf is arista.avd.defined %}
{% set name_server_cli = name_server_cli ~ " vrf " ~ name_server.vrf %}
{% endif %}
{% set name_server_cli = name_server_cli ~ " " ~ name_server.ip_address %}
{% if name_server.priority is arista.avd.defined %}
{% set name_server_cli = name_server_cli ~ " priority " ~ name_server.priority %}
{% endif %}
{{ name_server_cli }}
{% endfor %}
{% if ip_name_servers is arista.avd.defined %}
{% set all_name_servers = [] %}
{% for name_server in ip_name_servers %}
{% set server = {'ip_address':"",'priority': 0, 'vrf': 'default'} %}
{% do server.update({'ip_address': name_server.ip_address}) %}
{% if name_server.priority is arista.avd.defined %}
{% do server.update({'priority': name_server.priority}) %}
{% endif %}
{% if name_server.vrf is arista.avd.defined %}
{% do server.update({'vrf': name_server.vrf}) %}
{% endif %}
{% do all_name_servers.append(server) %}
{% endfor %}
{% for name_server in all_name_servers | arista.avd.natural_sort('ip_address') | arista.avd.natural_sort('vrf') | arista.avd.natural_sort('priority') %}
{% if name_server.priority | int == 0 %}
ip name-server vrf {{ name_server.vrf }} {{ name_server.ip_address }}
{% else %}
ip name-server vrf {{ name_server.vrf }} {{ name_server.ip_address }} priority {{ name_server.priority }}
{% endif %}
{% endfor %}
{% endif %}
17 changes: 13 additions & 4 deletions python-avd/pyavd/_eos_cli_config_gen/schema/__init__.py

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
Expand Up @@ -18,6 +18,7 @@ keys:
vrf:
description: VRF Name.
type: str
default: default
convert_types:
- int
priority:
Expand Down

0 comments on commit 6bda3c7

Please sign in to comment.