summaryrefslogtreecommitdiff
path: root/data/templates/ntp/ntp.conf.tmpl
diff options
context:
space:
mode:
Diffstat (limited to 'data/templates/ntp/ntp.conf.tmpl')
-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 %}