summaryrefslogtreecommitdiff
path: root/data/templates/login/pam_radius_auth.conf.tmpl
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-04-13 22:53:57 +0200
committerChristian Poessinger <christian@poessinger.com>2022-04-13 22:55:46 +0200
commit19859c09dd33a1126dc4b0d5cd0dbe309ed78ac2 (patch)
tree36122728a5c8a172b82443860e07ea83206c5384 /data/templates/login/pam_radius_auth.conf.tmpl
parent4df48d5713398800a74aae7f69932e9219a46f24 (diff)
downloadvyos-1x-19859c09dd33a1126dc4b0d5cd0dbe309ed78ac2.tar.gz
vyos-1x-19859c09dd33a1126dc4b0d5cd0dbe309ed78ac2.zip
login: radius: T4333: migrate to new vyos_defined Jinja2 test
Diffstat (limited to 'data/templates/login/pam_radius_auth.conf.tmpl')
-rw-r--r--data/templates/login/pam_radius_auth.conf.tmpl12
1 files changed, 6 insertions, 6 deletions
diff --git a/data/templates/login/pam_radius_auth.conf.tmpl b/data/templates/login/pam_radius_auth.conf.tmpl
index fad8e7dcb..4e34ade41 100644
--- a/data/templates/login/pam_radius_auth.conf.tmpl
+++ b/data/templates/login/pam_radius_auth.conf.tmpl
@@ -1,10 +1,10 @@
# Automatically generated by system-login.py
# RADIUS configuration file
-{% if radius is defined and radius is not none %}
+{% if radius is vyos_defined %}
{# RADIUS IPv6 source address must be specified in [] notation #}
{% set source_address = namespace() %}
-{% if radius.source_address is defined and radius.source_address is not none %}
+{% if radius.source_address is vyos_defined %}
{% for address in radius.source_address %}
{% if address | is_ipv4 %}
{% set source_address.ipv4 = address %}
@@ -13,15 +13,15 @@
{% endif %}
{% endfor %}
{% endif %}
-{% if radius.server is defined and radius.server is not none %}
+{% if radius.server is vyos_defined %}
# server[:port] shared_secret timeout source_ip
{# .items() returns a tuple of two elements: key and value. 1 relates to the 2nd element i.e. the value and .priority relates to the key from the internal dict #}
{% for server, options in radius.server.items() | sort(attribute='1.priority') if not options.disabled %}
{# RADIUS IPv6 servers must be specified in [] notation #}
{% if server | is_ipv4 %}
-{{ server }}:{{ options.port }} {{ "%-25s" | format(options.key) }} {{ "%-10s" | format(options.timeout) }} {{ source_address.ipv4 if source_address.ipv4 is defined }}
+{{ server }}:{{ options.port }} {{ "%-25s" | format(options.key) }} {{ "%-10s" | format(options.timeout) }} {{ source_address.ipv4 if source_address.ipv4 is vyos_defined }}
{% else %}
-[{{ server }}]:{{ options.port }} {{ "%-25s" | format(options.key) }} {{ "%-10s" | format(options.timeout) }} {{ source_address.ipv6 if source_address.ipv6 is defined }}
+[{{ server }}]:{{ options.port }} {{ "%-25s" | format(options.key) }} {{ "%-10s" | format(options.timeout) }} {{ source_address.ipv6 if source_address.ipv6 is vyos_defined }}
{% endif %}
{% endfor %}
{% endif %}
@@ -29,7 +29,7 @@
priv-lvl 15
mapped_priv_user radius_priv_user
-{% if radius.vrf is defined and radius.vrf is not none %}
+{% if radius.vrf is vyos_defined %}
vrf-name {{ radius.vrf }}
{% endif %}
{% endif %}