Skip to content

Commit

Permalink
Refactor(eos_cli_config_gen): Rearrange the eos-cli output to match e…
Browse files Browse the repository at this point in the history
…os order
  • Loading branch information
Laxmikant Chintakindi authored and Laxmikant Chintakindi committed Aug 20, 2024
1 parent e11ca28 commit f8ced25
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,19 @@ radius-server host 10.10.10.158 key 7 <removed>
| TACACS1 | tacacs+ | default | 10.10.10.249 |
| TACACS2 | tacacs+ | mgt | 192.168.10.157 |
| TACACS2 | tacacs+ | default | 10.10.10.248 |
| RADIUS2 | radius | mgt | 192.168.10.157 |
| RADIUS1 | radius | default | 192.168.10.157 |

#### AAA Server Groups Device Configuration

```eos
!
aaa group server radius RADIUS1
server 192.168.10.157
!
aaa group server radius RADIUS2
server 192.168.10.157 vrf mgt
!
aaa group server tacacs+ TACACS1
server 10.10.10.157 vrf mgt
server 10.10.10.249
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ tacacs-server host 10.10.10.158 key 7 071B245F5A
tacacs-server host 10.10.10.159 key 8a $kUVyoj7FVQ//yw9D2lbqjA==$kxxohBiofI46IX3pw18KYQ==$DOOM0l9uU4TrQt2kyA7XCKtjUA==
tacacs-server timeout 10
!
aaa group server radius RADIUS1
server 192.168.10.157
!
aaa group server radius RADIUS2
server 192.168.10.157 vrf mgt
!
aaa group server tacacs+ TACACS1
server 10.10.10.157 vrf mgt
server 10.10.10.249
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ aaa_server_groups:
- server: 192.168.10.157
vrf: mgt
- server: 10.10.10.248
- name: RADIUS2
type: radius
servers:
- server: 192.168.10.157
vrf: mgt
- name: RADIUS1
type: radius
servers:
- server: 192.168.10.157

## AAA Authentication
aaa_authentication:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,20 @@
that can be found in the LICENSE file.
#}
{# eos - aaa server groups #}
{% if aaa_server_groups is arista.avd.defined %}
{% for aaa_server_group in aaa_server_groups %}
{% if aaa_server_group.type is arista.avd.defined and aaa_server_group.name is arista.avd.defined %}
{% for aaa_server_group in aaa_server_groups | arista.avd.natural_sort('type') | arista.avd.natural_sort('name') %}
{% if aaa_server_group.type is arista.avd.defined and aaa_server_group.name is arista.avd.defined %}
!
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 %}

0 comments on commit f8ced25

Please sign in to comment.