summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorIndrajit Raychaudhuri <irc@indrajit.com>2024-12-30 19:03:34 -0600
committerIndrajit Raychaudhuri <irc@indrajit.com>2026-07-24 12:17:23 -0500
commit65c8d1538d0fa68d4e7306aa152cdc39ba082b6b (patch)
tree4f7797b8c5ee5515cc45e20c2bbf696b8fcee92c /data
parent282e1c4d27543bf7941b10685e633056dd04b2be (diff)
downloadvyos-1x-65c8d1538d0fa68d4e7306aa152cdc39ba082b6b.tar.gz
vyos-1x-65c8d1538d0fa68d4e7306aa152cdc39ba082b6b.zip
ddclient: T6981: Move nsupdate key mapping to Python
Relocate key mapping for 'nsupdate' (rfc2136) from Jinja template to Python. This keeps the template simpler and allows for more complex dict handling in Python.
Diffstat (limited to 'data')
-rw-r--r--data/templates/dns-dynamic/ddclient.conf.j210
1 files changed, 4 insertions, 6 deletions
diff --git a/data/templates/dns-dynamic/ddclient.conf.j2 b/data/templates/dns-dynamic/ddclient.conf.j2
index 98d1584a1..fd50a529d 100644
--- a/data/templates/dns-dynamic/ddclient.conf.j2
+++ b/data/templates/dns-dynamic/ddclient.conf.j2
@@ -29,19 +29,17 @@ if{{ ipv }}={{ address }}, \
# {{ config.description }}
{% endif %}
{% for host in config.host_name if config.host_name is vyos_defined %}
-{# ip_suffixes can be either of ['v4'], ['v6'], ['v4', 'v6'] for all protocols #}
-{% set ip_suffixes = ['v4', 'v6'] if config.ip_version == 'both'
- else [config.ip_version[2:]] %}
-{% set password = config.key if config.protocol == 'nsupdate'
- else config.password %}
{% set address = 'web' if config.address.web is vyos_defined
else config.address.interface %}
{% set web_options = config.address.web | default({}) %}
+{# ip_suffixes can be either of ['v4'], ['v6'], ['v4', 'v6'] for all protocols #}
+{% set ip_suffixes = ['v4', 'v6'] if config.ip_version == 'both'
+ else [config.ip_version[2:]] %}
# Web service dynamic DNS configuration for {{ service }}: [{{ config.protocol }}, {{ host }}]
{{ render_config(host, address, web_options, ip_suffixes,
protocol=config.protocol, server=config.server, zone=config.zone,
- login=config.username, password=password, ttl=config.ttl,
+ login=config.username, password=config.password, ttl=config.ttl,
min_interval=config.wait_time, max_interval=config.expiry_time) }}
{% endfor %}
{% endfor %}