summaryrefslogtreecommitdiff
path: root/data/templates/nhrp/opennhrp.conf.tmpl
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-04-13 22:52:26 +0200
committerChristian Poessinger <christian@poessinger.com>2022-04-13 22:52:26 +0200
commit7dd2249e43eeae9ae79e3e5d2e9fdac296d0edc0 (patch)
treea267d6428cb1ab3b701bf0ab5d0b36d74f3d7afe /data/templates/nhrp/opennhrp.conf.tmpl
parentd93daa4e6d219d61a102532684ab33717fd2eedb (diff)
downloadvyos-1x-7dd2249e43eeae9ae79e3e5d2e9fdac296d0edc0.tar.gz
vyos-1x-7dd2249e43eeae9ae79e3e5d2e9fdac296d0edc0.zip
nhrp: T4333: migrate to new vyos_defined Jinja2 test
Diffstat (limited to 'data/templates/nhrp/opennhrp.conf.tmpl')
-rw-r--r--data/templates/nhrp/opennhrp.conf.tmpl24
1 files changed, 12 insertions, 12 deletions
diff --git a/data/templates/nhrp/opennhrp.conf.tmpl b/data/templates/nhrp/opennhrp.conf.tmpl
index e9e9f692a..721d41e49 100644
--- a/data/templates/nhrp/opennhrp.conf.tmpl
+++ b/data/templates/nhrp/opennhrp.conf.tmpl
@@ -1,29 +1,29 @@
# Created by VyOS - manual changes will be overwritten
-{% if tunnel is defined and tunnel is not none %}
+{% if tunnel is vyos_defined %}
{% for name, tunnel_conf in tunnel.items() %}
-{% set type = 'spoke' if tunnel_conf.map is defined or tunnel_conf.dynamic_map is defined else 'hub' %}
-{% set profile_name = profile_map[name] if profile_map is defined and name in profile_map else '' %}
+{% set type = 'spoke' if tunnel_conf.map is vyos_defined or tunnel_conf.dynamic_map is vyos_defined else 'hub' %}
+{% set profile_name = profile_map[name] if profile_map is vyos_defined and name in profile_map else '' %}
interface {{ name }} #{{ type }} {{ profile_name }}
-{% if tunnel_conf.map is defined and tunnel_conf.map is not none %}
+{% if tunnel_conf.map is vyos_defined %}
{% for map, map_conf in tunnel_conf.map.items() %}
-{% set cisco = ' cisco' if map_conf.cisco is defined else '' %}
-{% set register = ' register' if map_conf.register is defined else '' %}
+{% set cisco = ' cisco' if map_conf.cisco is vyos_defined else '' %}
+{% set register = ' register' if map_conf.register is vyos_defined else '' %}
map {{ map }} {{ map_conf.nbma_address }}{{ register }}{{ cisco }}
{% endfor %}
{% endif %}
-{% if tunnel_conf.dynamic_map is defined and tunnel_conf.dynamic_map is not none %}
+{% if tunnel_conf.dynamic_map is vyos_defined %}
{% for map, map_conf in tunnel_conf.dynamic_map.items() %}
dynamic-map {{ map }} {{ map_conf.nbma_domain_name }}
{% endfor %}
{% endif %}
-{% if tunnel_conf.cisco_authentication is defined and tunnel_conf.cisco_authentication is not none %}
+{% if tunnel_conf.cisco_authentication is vyos_defined %}
cisco-authentication {{ tunnel_conf.cisco_authentication }}
{% endif %}
-{% if tunnel_conf.holding_time is defined and tunnel_conf.holding_time is not none %}
+{% if tunnel_conf.holding_time is vyos_defined %}
holding-time {{ tunnel_conf.holding_time }}
{% endif %}
-{% if tunnel_conf.multicast is defined and tunnel_conf.multicast is not none %}
+{% if tunnel_conf.multicast is vyos_defined %}
multicast {{ tunnel_conf.multicast }}
{% endif %}
{% for key in ['non_caching', 'redirect', 'shortcut', 'shortcut_destination'] %}
@@ -31,9 +31,9 @@ interface {{ name }} #{{ type }} {{ profile_name }}
{{ key | replace("_", "-") }}
{% endif %}
{% endfor %}
-{% if tunnel_conf.shortcut_target is defined and tunnel_conf.shortcut_target is not none %}
+{% if tunnel_conf.shortcut_target is vyos_defined %}
{% for target, shortcut_conf in tunnel_conf.shortcut_target.items() %}
- shortcut-target {{ target }}{{ ' holding-time ' + shortcut_conf.holding_time if shortcut_conf.holding_time is defined }}
+ shortcut-target {{ target }}{{ ' holding-time ' + shortcut_conf.holding_time if shortcut_conf.holding_time is vyos_defined }}
{% endfor %}
{% endif %}