summaryrefslogtreecommitdiff
path: root/data/templates
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-04-05 16:53:38 +0200
committerChristian Poessinger <christian@poessinger.com>2020-04-05 16:53:38 +0200
commit579275e495a7835244f00b74b5aae3d9121a5b24 (patch)
treedbe8a105e78678734d892fe0ca28adefce855c00 /data/templates
parentbfc41f51ddc6cdef899a7da3ac84daf80e5f55cd (diff)
downloadvyos-1x-579275e495a7835244f00b74b5aae3d9121a5b24.tar.gz
vyos-1x-579275e495a7835244f00b74b5aae3d9121a5b24.zip
ntp: T2230: move inlined templates to dedicated files
Diffstat (limited to 'data/templates')
-rw-r--r--data/templates/ntp/ntp.conf.tmpl38
1 files changed, 38 insertions, 0 deletions
diff --git a/data/templates/ntp/ntp.conf.tmpl b/data/templates/ntp/ntp.conf.tmpl
new file mode 100644
index 000000000..52042d218
--- /dev/null
+++ b/data/templates/ntp/ntp.conf.tmpl
@@ -0,0 +1,38 @@
+### Autogenerated by ntp.py ###
+
+#
+# Non-configurable defaults
+#
+driftfile /var/lib/ntp/ntp.drift
+# By default, only allow ntpd to query time sources, ignore any incoming requests
+restrict default noquery nopeer notrap nomodify
+# Local users have unrestricted access, allowing reconfiguration via ntpdc
+restrict 127.0.0.1
+restrict -6 ::1
+
+#
+# Configurable section
+#
+
+{% if servers -%}
+{% for s in servers -%}
+# Server configuration for: {{ s.name }}
+server {{ s.name }} iburst {{ s.options | join(" ") }}
+{% endfor -%}
+{% endif %}
+
+{% if allowed_networks -%}
+{% for n in allowed_networks -%}
+# Client configuration for network: {{ n.network }}
+restrict {{ n.address }} mask {{ n.netmask }} nomodify notrap nopeer
+
+{% endfor -%}
+{% endif %}
+
+{% if listen_address -%}
+# NTP should listen on configured addresses only
+interface ignore wildcard
+{% for a in listen_address -%}
+interface listen {{ a }}
+{% endfor -%}
+{% endif %}