From 90e23edac94dd9044bc71e4209f919a7480a8bb9 Mon Sep 17 00:00:00 2001 From: Laxmikant Chintakindi Date: Wed, 27 Nov 2024 13:07:50 +0530 Subject: [PATCH] Fix template --- .../j2templates/eos/aaa-server-groups-ldap.j2 | 29 +++++++++---------- .../eos/aaa-server-groups-radius.j2 | 29 +++++++++---------- .../eos/aaa-server-groups-tacacs-plus.j2 | 29 +++++++++---------- 3 files changed, 39 insertions(+), 48 deletions(-) diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/aaa-server-groups-ldap.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/aaa-server-groups-ldap.j2 index a8429b95fb4..a6170c356c7 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/aaa-server-groups-ldap.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/aaa-server-groups-ldap.j2 @@ -4,23 +4,20 @@ that can be found in the LICENSE file. #} {# eos - aaa server groups ldap #} -{% if aaa_server_groups is arista.avd.defined %} -{% set aaa_server_groups = aaa_server_groups | selectattr('type', 'arista.avd.defined') | list %} -{% for aaa_server_group in aaa_server_groups | arista.avd.natural_sort('name') %} -{% if aaa_server_group.type | arista.avd.default == 'ldap' %} +{% for aaa_server_group in aaa_server_groups | arista.avd.natural_sort('name') %} +{% if aaa_server_group.type is arista.avd.defined('ldap') %} ! aaa group server {{ aaa_server_group.type }} {{ aaa_server_group.name }} -{% if aaa_server_group.servers is arista.avd.defined %} -{% for server in aaa_server_group.servers %} -{% if server.server is arista.avd.defined %} -{% set server_cli = "server " ~ server.server %} -{% if server.vrf is arista.avd.defined %} -{% set server_cli = server_cli ~ " vrf " ~ server.vrf %} -{% endif %} - {{ server_cli }} +{% if aaa_server_group.servers is arista.avd.defined %} +{% for server in aaa_server_group.servers %} +{% if server.server is arista.avd.defined %} +{% set server_cli = "server " ~ server.server %} +{% if server.vrf is arista.avd.defined %} +{% set server_cli = server_cli ~ " vrf " ~ server.vrf %} {% endif %} -{% endfor %} -{% endif %} + {{ server_cli }} +{% endif %} +{% endfor %} {% endif %} -{% endfor %} -{% endif %} +{% endif %} +{% endfor %} diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/aaa-server-groups-radius.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/aaa-server-groups-radius.j2 index 8172b882845..72a9f3f6ba1 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/aaa-server-groups-radius.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/aaa-server-groups-radius.j2 @@ -4,23 +4,20 @@ that can be found in the LICENSE file. #} {# eos - aaa server groups #} -{% if aaa_server_groups is arista.avd.defined %} -{% set aaa_server_groups = aaa_server_groups | selectattr('type', 'arista.avd.defined') | list %} -{% for aaa_server_group in aaa_server_groups | arista.avd.natural_sort('name') %} -{% if aaa_server_group.type | arista.avd.default == 'radius' %} +{% for aaa_server_group in aaa_server_groups | arista.avd.natural_sort('name') %} +{% if aaa_server_group.type is arista.avd.defined('radius') %} ! aaa group server {{ aaa_server_group.type }} {{ aaa_server_group.name }} -{% if aaa_server_group.servers is arista.avd.defined %} -{% for server in aaa_server_group.servers %} -{% if server.server is arista.avd.defined %} -{% set server_cli = "server " ~ server.server %} -{% if server.vrf is arista.avd.defined %} -{% set server_cli = server_cli ~ " vrf " ~ server.vrf %} -{% endif %} - {{ server_cli }} +{% if aaa_server_group.servers is arista.avd.defined %} +{% for server in aaa_server_group.servers %} +{% if server.server is arista.avd.defined %} +{% set server_cli = "server " ~ server.server %} +{% if server.vrf is arista.avd.defined %} +{% set server_cli = server_cli ~ " vrf " ~ server.vrf %} {% endif %} -{% endfor %} -{% endif %} + {{ server_cli }} +{% endif %} +{% endfor %} {% endif %} -{% endfor %} -{% endif %} +{% endif %} +{% endfor %} diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/aaa-server-groups-tacacs-plus.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/aaa-server-groups-tacacs-plus.j2 index 52548c8a428..78be17a2534 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/aaa-server-groups-tacacs-plus.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/aaa-server-groups-tacacs-plus.j2 @@ -4,23 +4,20 @@ that can be found in the LICENSE file. #} {# eos - aaa server groups #} -{% if aaa_server_groups is arista.avd.defined %} -{% set aaa_server_groups = aaa_server_groups | selectattr('type', 'arista.avd.defined') | list %} -{% for aaa_server_group in aaa_server_groups | arista.avd.natural_sort('name') %} -{% if aaa_server_group.type is arista.avd.defined('tacacs+') %} +{% for aaa_server_group in aaa_server_groups | arista.avd.natural_sort('name') %} +{% if aaa_server_group.type is arista.avd.defined('tacacs+') %} ! aaa group server {{ aaa_server_group.type }} {{ aaa_server_group.name }} -{% if aaa_server_group.servers is arista.avd.defined %} -{% for server in aaa_server_group.servers %} -{% if server.server is arista.avd.defined %} -{% set server_cli = "server " ~ server.server %} -{% if server.vrf is arista.avd.defined %} -{% set server_cli = server_cli ~ " vrf " ~ server.vrf %} -{% endif %} - {{ server_cli }} +{% if aaa_server_group.servers is arista.avd.defined %} +{% for server in aaa_server_group.servers %} +{% if server.server is arista.avd.defined %} +{% set server_cli = "server " ~ server.server %} +{% if server.vrf is arista.avd.defined %} +{% set server_cli = server_cli ~ " vrf " ~ server.vrf %} {% endif %} -{% endfor %} -{% endif %} + {{ server_cli }} +{% endif %} +{% endfor %} {% endif %} -{% endfor %} -{% endif %} +{% endif %} +{% endfor %}