File: //etc/cloud/templates/chrony.conf.tmpl
## template:jinja
# Use Alibaba NTP server
# Public NTP
# Alicloud NTP
{% if ntp_servers is defined %}
{% for ntp_server in ntp_servers -%}
server {{ntp_server}} minpoll 4 maxpoll 10 iburst
{% endfor %}
{% endif %}
# Ignore stratum in source selection.
stratumweight 0.05
# Record the rate at which the system clock gains/losses time.
driftfile /var/lib/chrony/drift
# Enable kernel RTC synchronization.
rtcsync
# In first three updates step the system clock instead of slew
# if the adjustment is larger than 10 seconds.
makestep 10 3
# Allow NTP client access from local network.
#allow 192.168/16
# Listen for commands only on localhost.
bindcmdaddress 127.0.0.1
bindcmdaddress ::1
# Serve time even if not synchronized to any NTP server.
#local stratum 10
# Disable logging of client accesses.
noclientlog
# Send a message to syslog if a clock adjustment is larger than 0.5 seconds.
logchange 0.5
logdir /var/log/chrony
#log measurements statistics tracking