summaryrefslogtreecommitdiff
path: root/data/templates/chrony/chrony.conf.j2
blob: 711bbbec74af9a3ed229e0b4b459e567c8a81c8d (plain)
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
### Autogenerated by ntp.py ###

# This would step the system clock if the adjustment is larger than 0.1 seconds,
# but only in the first three clock updates.
makestep 1.0 3

# The rtcsync directive enables a mode where the system time is periodically
# copied to the RTC and chronyd does not try to track its drift. This directive
# cannot be used with the rtcfile directive. On Linux, the RTC copy is performed
# by the kernel every 11 minutes.
rtcsync

# This directive specifies the maximum amount of memory that chronyd is allowed
# to allocate for logging of client accesses and the state that chronyd as an
# NTP server needs to support the interleaved mode for its clients.
clientloglimit 1048576

driftfile /run/chrony/drift
dumpdir /run/chrony
pidfile {{ config_file | replace('.conf', '.pid') }}

# Determine when will the next leap second occur and what is the current offset
leapsectz right/UTC

user {{ user }}

# NTP servers to reach out to
{% if server is vyos_defined %}
{%     for server, config in server.items() %}
{%         set association = 'server' %}
{%         if config.pool is vyos_defined %}
{%             set association = 'pool' %}
{%         endif %}
{{ association }} {{ server | replace('_', '-') }} iburst {{ 'noselect' if config.noselect is vyos_defined }} {{ 'prefer' if config.prefer is vyos_defined }}
{%     endfor %}
{% endif %}

# Allowed clients configuration
{% if allow_client.address is vyos_defined %}
{%     for address in allow_client.address %}
allow {{ address }}
{%     endfor %}
{% else %}
deny all
{% endif %}

{% if listen_address is vyos_defined or interface is vyos_defined %}
# NTP should listen on configured addresses only
{%     if listen_address is vyos_defined %}
{%         for address in listen_address %}
bindaddress {{ address }}
{%         endfor %}
{%     endif %}
{%     if interface is vyos_defined %}
{%         for ifname in interface %}
binddevice {{ ifname }}
{%         endfor %}
{%     endif %}
{% endif %}