summaryrefslogtreecommitdiff
path: root/data/templates/ipsec/swanctl/profile.tmpl
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/swanctl/profile.tmpl
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/swanctl/profile.tmpl')
-rw-r--r--data/templates/ipsec/swanctl/profile.tmpl10
1 files changed, 5 insertions, 5 deletions
diff --git a/data/templates/ipsec/swanctl/profile.tmpl b/data/templates/ipsec/swanctl/profile.tmpl
index a5cae31c0..0f1c2fda2 100644
--- a/data/templates/ipsec/swanctl/profile.tmpl
+++ b/data/templates/ipsec/swanctl/profile.tmpl
@@ -2,14 +2,14 @@
{# peer needs to reference the global IKE configuration for certain values #}
{% set ike = ike_group[profile_conf.ike_group] %}
{% set esp = esp_group[profile_conf.esp_group] %}
-{% if profile_conf.bind is defined and profile_conf.bind.tunnel is defined %}
+{% if profile_conf.bind.tunnel is vyos_defined %}
{% for interface in profile_conf.bind.tunnel %}
dmvpn-{{ name }}-{{ interface }} {
proposals = {{ ike_group[profile_conf.ike_group] | get_esp_ike_cipher | join(',') }}
- version = {{ ike.key_exchange[4:] if ike is defined and ike.key_exchange is defined else "0" }}
+ version = {{ ike.key_exchange[4:] if ike.key_exchange is vyos_defined else "0" }}
rekey_time = {{ ike.lifetime }}s
keyingtries = 0
-{% if profile_conf.authentication is defined and profile_conf.authentication.mode is defined and profile_conf.authentication.mode == 'pre-shared-secret' %}
+{% if profile_conf.authentication.mode is vyos_defined('pre-shared-secret') %}
local {
auth = psk
}
@@ -25,10 +25,10 @@
local_ts = dynamic[gre]
remote_ts = dynamic[gre]
mode = {{ esp.mode }}
-{% if ike.dead_peer_detection is defined and ike.dead_peer_detection.action is defined %}
+{% if ike.dead_peer_detection.action is vyos_defined %}
dpd_action = {{ ike.dead_peer_detection.action }}
{% endif %}
-{% if esp.compression is defined and esp.compression == 'enable' %}
+{% if esp.compression is vyos_defined('enable') %}
ipcomp = yes
{% endif %}
}