]> git.openstreetmap.org Git - chef.git/blob - cookbooks/ntp/templates/default/chrony.conf.erb
blogs: fix bundler install run as blogs user
[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 pool time.google.com iburst
16
17 # Allow local queries for monitoring
18 allow 127.0.0.1/32
19 allow ::1/128
20
21 # Run an initial NTP sync on daemon startup
22 # Use a few IPs here to workaround DNSSEC failure if time is wrong: https://github.com/openstreetmap/operations/issues/654
23 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(" ") %>
24
25 <% if node[:lsb][:release].to_f >= 22.04 -%>
26 # Use NTP sources found in /etc/chrony/sources.d.
27 sourcedir /etc/chrony/sources.d
28 <% end -%>
29
30 # This directive specify the location of the file containing ID/key pairs for
31 # NTP authentication.
32 keyfile /etc/chrony/chrony.keys
33
34 # This directive specify the file into which chronyd will store the rate
35 # information.
36 driftfile /var/lib/chrony/chrony.drift
37
38 <% if node[:lsb][:release].to_f >= 22.04 -%>
39 # Save NTS keys and cookies.
40 ntsdumpdir /var/lib/chrony
41 <% end -%>
42
43 # Uncomment the following line to turn logging on.
44 #log tracking measurements statistics
45
46 # Log files location.
47 logdir /var/log/chrony
48
49 # Stop bad estimates upsetting machine clock.
50 maxupdateskew 100.0
51
52 # This directive enables kernel synchronisation (every 11 minutes) of the
53 # real-time clock. Note that it can’t be used along with the 'rtcfile' directive.
54 rtcsync
55
56 <% if node[:virtualization][:role] == "guest" -%>
57 # Allow anytime step on VM guests
58 makestep 1 -1
59 <% else -%>
60 # Step the system clock instead of slewing it if the adjustment is larger than
61 # one second, but only in the first three clock updates.
62 makestep 1 3
63 <% end -%>
64
65 # Enable leap second slew
66 leapsecmode slew
67 maxslewrate 1000
68
69 # Enable hardware timestamps if available
70 hwtimestamp *