blob: 7b23f0050d813e73b0be72bf04239ffc6b2d8e08 [file] [log] [blame]
{%- from "ntp/map.jinja" import client with context %}
{%- from "ntp/map.jinja" import server with context %}
# ntpd will only synchronize your clock.
# For details, see:
# - the ntp.conf man page
# - http://support.ntp.org/bin/view/Support/GettingStarted
# - https://wiki.archlinux.org/index.php/Network_Time_Protocol_daemon
# Associate to Czech public NTP pool servers
{%- for stratum in client.strata %}
server {{ stratum }}{% if loop.first %} iburst{% endif %}
{%- endfor %}
# Only allow read-only access from localhost
restrict default noquery nopeer
restrict 127.0.0.1
restrict ::1
{%- if client.get('mode7') %}
# mode7 is required for collectd monitoring
enable mode7
{%- endif %}
{%- if server.get('enabled', False) %}
# Provide your current local time as a default should you temporarly lose Internet connectivity
server 127.127.1.0
fudge 127.127.1.0 stratum 10
# Allow restrict machines to synchronize with this ntp server
{%- for r in server.get('restrict', {}) %}
restrict {{ r.subnet }} mask {{ r.mask }} {{ r.options|default('nomodify notrap') }}
{%- endfor %}
# Exchange time with everybody, but don't allow configuration.
#restrict -4 default kod notrap nomodify nopeer noquery
#restrict -6 default kod notrap nomodify nopeer noquery
{%- endif %}
# Location of drift file
driftfile /var/lib/ntp/ntp.drift
logfile /var/log/ntp.log