summaryrefslogtreecommitdiff
path: root/data/templates/ipsec/charon
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-04-13 22:51:42 +0200
committerChristian Poessinger <christian@poessinger.com>2022-04-13 22:51:42 +0200
commite8a637eec0cc398f78a877ece6b9c7cdca418970 (patch)
treed5950ea33e209a3a290b617d501807959102a9d0 /data/templates/ipsec/charon
parentfc36d67b051bad776a5b1d6e9a04f1205487f01f (diff)
downloadvyos-1x-e8a637eec0cc398f78a877ece6b9c7cdca418970.tar.gz
vyos-1x-e8a637eec0cc398f78a877ece6b9c7cdca418970.zip
ipsec: T4333: migrate to new vyos_defined Jinja2 test
Diffstat (limited to 'data/templates/ipsec/charon')
-rw-r--r--data/templates/ipsec/charon/dhcp.conf.tmpl8
-rw-r--r--data/templates/ipsec/charon/eap-radius.conf.tmpl8
2 files changed, 7 insertions, 9 deletions
diff --git a/data/templates/ipsec/charon/dhcp.conf.tmpl b/data/templates/ipsec/charon/dhcp.conf.tmpl
index 92774b275..aaa5613fb 100644
--- a/data/templates/ipsec/charon/dhcp.conf.tmpl
+++ b/data/templates/ipsec/charon/dhcp.conf.tmpl
@@ -1,12 +1,10 @@
dhcp {
load = yes
-{% if remote_access is defined and remote_access.dhcp is defined %}
-{% if remote_access.dhcp.interface is defined %}
+{% if remote_access.dhcp.interface is vyos_defined %}
interface = {{ remote_access.dhcp.interface }}
-{% endif %}
-{% if remote_access.dhcp.server is defined %}
+{% endif %}
+{% if remote_access.dhcp.server is vyos_defined %}
server = {{ remote_access.dhcp.server }}
-{% endif %}
{% endif %}
# Always use the configured server address.
diff --git a/data/templates/ipsec/charon/eap-radius.conf.tmpl b/data/templates/ipsec/charon/eap-radius.conf.tmpl
index 5ec35c988..b58022521 100644
--- a/data/templates/ipsec/charon/eap-radius.conf.tmpl
+++ b/data/templates/ipsec/charon/eap-radius.conf.tmpl
@@ -41,7 +41,7 @@ eap-radius {
load = yes
# NAS-Identifier to include in RADIUS messages.
- nas_identifier = {{ remote_access.radius.nas_identifier if remote_access is defined and remote_access.radius is defined and remote_access.radius.nas_identifier is defined else 'strongSwan' }}
+ nas_identifier = {{ remote_access.radius.nas_identifier if remote_access.radius.nas_identifier is vyos_defined else 'strongSwan' }}
# Port of RADIUS server (authentication).
# port = 1812
@@ -94,13 +94,13 @@ eap-radius {
# Section to specify multiple RADIUS servers.
servers {
-{% if remote_access is defined and remote_access.radius is defined and remote_access.radius.server is defined %}
-{% for server, server_options in remote_access.radius.server.items() if server_options.disable is not defined %}
+{% if remote_access.radius.server is vyos_defined %}
+{% for server, server_options in remote_access.radius.server.items() if server_options.disable is not vyos_defined %}
{{ server | replace('.', '-') }} {
address = {{ server }}
secret = {{ server_options.key }}
auth_port = {{ server_options.port }}
-{% if server_options.disable_accounting is not defined %}
+{% if server_options.disable_accounting is not vyos_defined %}
acct_port = {{ server_options.port | int +1 }}
{% endif %}
sockets = 20