]> git.openstreetmap.org Git - chef.git/blob - cookbooks/ntp/templates/default/chrony.conf.erb
Only try and create standby.signal if the cluster exists
[chef.git] / cookbooks / ntp / templates / default / chrony.conf.erb
1 # DO NOT EDIT - This file is being maintained by Chef
2
3 <% if node[:lsb][:release].to_f >= 22.04 -%>
4 # Include configuration files found in /etc/chrony/conf.d.
5 confdir /etc/chrony/conf.d
6 <% end -%>
7
8 # Servers
9 <% node[:ntp][:servers].each do |server| -%>
10 pool <%= server %> iburst
11 <% end -%>
12 # Add additional non-pool NTP servers
13 # pool.ntp.org can sometimes be aggressive with KoD
14 pool time.cloudflare.com iburst
15 server time1.google.com iburst
16 server time2.google.com iburst
17 server time3.google.com iburst
18 server time4.google.com iburst
19
20 # Allow local queries for monitoring
21 allow 127.0.0.1/32
22 allow ::1/128
23
24 # Run an initial NTP sync on daemon startup
25 # Use a few IPs here to workaround DNSSEC failure if time is wrong: https://github.com/openstreetmap/operations/issues/654
26 initstepslew 30 216.239.35.0 216.239.35.4 216.239.35.8 216.239.35.12 time.google.com time.cloudflare.com <%= node[:ntp][:servers].join(" ") %>
27
28 <% if node[:lsb][:release].to_f >= 22.04 -%>
29 # Use NTP sources found in /etc/chrony/sources.d.
30 sourcedir /etc/chrony/sources.d
31 <% end -%>
32
33 # This directive specify the location of the file containing ID/key pairs for
34 # NTP authentication.
35 keyfile /etc/chrony/chrony.keys
36
37 # This directive specify the file into which chronyd will store the rate
38 # information.
39 driftfile /var/lib/chrony/chrony.drift
40
41 <% if node[:lsb][:release].to_f >= 22.04 -%>
42 # Save NTS keys and cookies.
43 ntsdumpdir /var/lib/chrony
44 <% end -%>
45
46 # Uncomment the following line to turn logging on.
47 #log tracking measurements statistics
48
49 # Log files location.
50 logdir /var/log/chrony
51
52 # Stop bad estimates upsetting machine clock.
53 maxupdateskew 100.0
54
55 # This directive enables kernel synchronisation (every 11 minutes) of the
56 # real-time clock. Note that it can’t be used along with the 'rtcfile' directive.
57 rtcsync
58
59 <% if node[:virtualization][:role] == "guest" -%>
60 # Allow anytime step on VM guests
61 makestep 1 -1
62 <% else -%>
63 # Step the system clock instead of slewing it if the adjustment is larger than
64 # one second, but only in the first three clock updates.
65 makestep 1 3
66 <% end -%>
67
68 # Enable leap second slew
69 leapsecmode slew
70 maxslewrate 1000
71
72 # Enable hardware timestamps if available
73 hwtimestamp *