Skip to content

Commit

Permalink
Minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Laxmikant Chintakindi authored and Laxmikant Chintakindi committed Dec 5, 2024
1 parent 530efbe commit 0cdd09f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ ip name-server group mynameserver0
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 8.8.8.8 priority 0
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ ip_name_server_groups:
name_servers:
- ip_address: 8.8.8.8
vrf: vrf1
priority: 0
- ip_address: 1.1.1.1
- ip_address: 2.2.2.2
vrf: vrf1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
ip name-server group {{ name_server_group.name }}
{% set all_server_groups = [] %}
{% for name_server in name_server_group.name_servers | arista.avd.default([]) %}
{% set server = {"priority": "0 ", "vrf": "default", "ip_address": "-"} %}
{% set server = {"priority": "0", "vrf": "default", "ip_address": "-", "priority_defined": false} %}
{% if name_server.priority is arista.avd.defined %}
{% do server.update({"priority": name_server.priority}) %}
{% do server.update({"priority": name_server.priority, "priority_defined": true}) %}
{% endif %}
{% do server.update({"ip_address": name_server.ip_address}) %}
{% if name_server.vrf is arista.avd.defined %}
Expand All @@ -19,7 +19,7 @@ ip name-server group {{ name_server_group.name }}
{% do all_server_groups.append(server) %}
{% endfor %}
{% for server in all_server_groups | arista.avd.natural_sort("ip_address") | arista.avd.natural_sort("vrf") | arista.avd.natural_sort("priority") %}
{% if server.priority == '0 ' %}
{% if not server.priority_defined %}
{% set name_server_cli = "name-server vrf " ~ server["vrf"] ~ " " ~ server["ip_address"] %}
{% else %}
{% set name_server_cli = "name-server vrf " ~ server["vrf"] ~ " " ~ server["ip_address"] ~ " priority " ~ server["priority"] %}
Expand Down

0 comments on commit 0cdd09f

Please sign in to comment.