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.tmpl18
1 files changed, 5 insertions, 13 deletions
diff --git a/data/templates/ntp/ntp.conf.tmpl b/data/templates/ntp/ntp.conf.tmpl
index 1c51929fd..df8157a41 100644
--- a/data/templates/ntp/ntp.conf.tmpl
+++ b/data/templates/ntp/ntp.conf.tmpl
@@ -19,29 +19,21 @@ restrict -6 ::1
{% 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 }} iburst {{ options }}
+server {{ srv | replace('_', '-') }} iburst {{ options }}
{% endfor %}
{% endif %}
{% if allow_clients is defined and allow_clients.address is defined %}
# Allowed clients configuration
-{% if allow_clients.address is string %}
-restrict {{ allow_clients.address|address_from_cidr }} mask {{ allow_clients.address|netmask_from_cidr }} nomodify notrap nopeer
-{% else %}
-{% for address in allow_clients.address %}
+{% for address in allow_clients.address %}
restrict {{ address|address_from_cidr }} mask {{ address|netmask_from_cidr }} nomodify notrap nopeer
-{% endfor %}
-{% endif %}
+{% endfor %}
{% endif %}
{% if listen_address %}
# NTP should listen on configured addresses only
interface ignore wildcard
-{% if listen_address is string %}
-interface listen {{ listen_address }}
-{% else %}
-{% for address in listen_address %}
+{% for address in listen_address %}
interface listen {{ address }}
-{% endfor %}
-{% endif %}
+{% endfor %}
{% endif %}