From 3169f1270fe8217fe57c9301e48b550539f14b77 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 29 Nov 2020 13:32:03 +0100 Subject: ntp: T2297: support configuration of NTP pool set system ntp server pool --- data/templates/ntp/ntp.conf.tmpl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'data/templates') 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 %} -- cgit v1.2.3