Pierre Riteau a1490bd592 Replace pause with chronyc waitsync in ntp sync
`chronyc waitsync 60 0.01` will wait up to about 10 minutes (60 times 10
seconds) for chronyd to synchronise to a source and the remaining
correction to be less than 10 milliseconds [1].

Also flush handlers to restart chronyd before synchronising the clock.

Force system clock synchronisation in CI jobs. This allows us to run
test_ntp_clock_synchronized on Ubuntu again.

[1] https://chrony-project.org/doc/4.6.1/chronyc.html

Change-Id: I73e7f2a3258e5427ec16b01e7482093d7bfb33f8
(cherry picked from commit 8dd05487d4ef872e7d3467e74fd6ab5141361d68)
2025-02-18 19:42:12 +00:00

55 lines
1.8 KiB
Plaintext

---
# Kayobe time configuration.
###############################################################################
# Timezone.
# Name of the local timezone.
timezone: "{{ ansible_facts.date_time.tz }}"
###############################################################################
# Network Time Protocol (NTP).
# List of NTP time sources to configure. Format is a list of dictionaries with
# the following keys:
# server: host or pool
# type: (Optional) Defaults to server. Maps to a time source in the
# configuration file. Can be one of server, peer, pool.
# options: (Optional) List of options that depends on type, see Chrony
# documentation for details.
# See: https://chrony.tuxfamily.org/doc/4.0/chrony.conf.html
#
# Example of configuring a pool and customising the pool specific maxsources
# option:
# chrony_ntp_servers:
# - server: pool.ntp.org
# type: pool
# options:
# - option: maxsources
# val: 3
#
chrony_ntp_servers:
- server: pool.ntp.org
type: pool
options:
- option: iburst
- option: minpoll
val: 8
# Synchronise hardware clock with system time. Default is true.
chrony_rtcsync_enabled: true
# Force synchronisation from NTP sources. This methods may jump the clock by
# large values which can cause issues with some software. Disabled by default.
ntp_force_sync: false
# Maximum number of tries used by the `chronyc waitsync` command. Only used
# when ntp_force_sync is true. Default is 60 which waits for a maximum of 10
# minutes (60 times 10 seconds).
chrony_waitsync_max_tries: 60
# Maximum correction used by the `chronyc waitsync` command. Only used when
# ntp_force_sync is true. Default is 0.01 which waits for the remaining
# correction to be less than 10 milliseconds.
chrony_waitsync_max_correction: 0.01