-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathntp.conf.j2
36 lines (29 loc) · 1.16 KB
/
ntp.conf.j2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# {{ ansible_managed }}
{% for value in timesync_ntp_servers %}
{{ 'pool' if 'pool' in value and value['pool'] else 'server' }} {{
value['hostname'] }}{{
' minpoll {0}'.format(value['minpoll']) if 'minpoll' in value else '' }}{{
' maxpoll {0}'.format(value['maxpoll']) if 'maxpoll' in value else '' }}{{
' iburst' if 'iburst' in value and value else '' }}
{% endfor %}
driftfile /var/lib/ntp/drift
# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
restrict default nomodify notrap nopeer noquery
{% if timesync_ntp_version.stdout is version('4.2.6', '<') %}
restrict -6 default nomodify notrap nopeer noquery
{% endif %}
# Permit all access over the loopback interface. This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict 127.0.0.1
restrict ::1
{% if timesync_step_threshold >= 0.0 %}
# Specify the step threshold.
tinker step {{ timesync_step_threshold }}
{% endif %}
{% if timesync_min_sources > 1 %}
# Increase the minimum number of selectable sources required to adjust
# the system clock.
tos minsane {{ timesync_min_sources }}
{% endif %}