Pierre Riteau 9c6b4477f8 Support forcing time synchronisation
This adds support for forcing time synchronisation after configuring
chrony if ntp_force_sync is changed to True.

Change-Id: I4e0fd325e2ceb698f1f959bc060b68bd629750e0
Co-Authored-By: Will Szumski <will@stackhpc.com>
2024-10-07 22:41:09 +02:00

18 lines
387 B
YAML

---
- name: Force time synchronisation
become: True
block:
- name: Configure burst
command: chronyc 'burst 4/4'
- name: Step the clock
command: chronyc makestep
- name: Wait before hardware clock synchronisation
pause:
seconds: 5
- name: Force hardware clock synchronisation
command: hwclock --systohc
when: ntp_force_sync | bool