summaryrefslogtreecommitdiff
path: root/data/templates/ntp
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-11-29 13:32:03 +0100
committerChristian Poessinger <christian@poessinger.com>2020-11-29 13:32:03 +0100
commit3169f1270fe8217fe57c9301e48b550539f14b77 (patch)
treea25362564be4d7e27ce89b05660c722c6efe5100 /data/templates/ntp
parentcacbc208d0802806de2c671e41607d605138aaa5 (diff)
downloadvyos-1x-3169f1270fe8217fe57c9301e48b550539f14b77.tar.gz
vyos-1x-3169f1270fe8217fe57c9301e48b550539f14b77.zip
ntp: T2297: support configuration of NTP pool
set system ntp server <server> pool
Diffstat (limited to 'data/templates/ntp')
-rw-r--r--data/templates/ntp/ntp.conf.tmpl14
1 files changed, 7 insertions, 7 deletions
diff --git a/data/templates/ntp/ntp.conf.tmpl b/data/templates/ntp/ntp.conf.tmpl
index bb0067bfb..3f319c89b 100644
--- a/data/templates/ntp/ntp.conf.tmpl
+++ b/data/templates/ntp/ntp.conf.tmpl
@@ -13,13 +13,13 @@ restrict -6 ::1
#
# Configurable section
#
-{% if server %}
-{% for srv in server %}
-{% set options = '' %}
-{% set options = options + 'noselect ' if server[srv].noselect is defined else '' %}
-{% set options = options + 'preempt ' if server[srv].preempt is defined else '' %}
-{% set options = options + 'prefer ' if server[srv].prefer is defined else '' %}
-server {{ srv | replace('_', '-') }} iburst {{ options }}
+{% if server is defined and server is not none %}
+{% for server, config in server.items() %}
+{% set association = 'server' %}
+{% if config.pool is defined %}
+{% set association = 'pool' %}
+{% endif %}
+{{ association }} {{ server | replace('_', '-') }} iburst {{ 'noselect' if config.noselect is defined }} {{ 'preempt' if config.preempt is defined }} {{ 'prefer' if config.prefer is defined }}
{% endfor %}
{% endif %}