Skip to content

Commit 80f34c9

Browse files
committed
Block until timedatectl status show synchronized
Should reduce incidents of time sync issues when running kolla pre-checks. Change-Id: Iad7fc73f16ffcbc2ab5f261322bd6777036fd5f6 Signed-off-by: Will Szumski <will@stackhpc.com> (cherry picked from commit f23ced2)
1 parent 4fb0096 commit 80f34c9

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

ansible/roles/ntp/tasks/sync.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,13 @@
2323

2424
- name: Force hardware clock synchronisation
2525
command: hwclock --systohc
26+
27+
- name: Wait for system clock to be synchronized (up to 10 minutes)
28+
become: True
29+
ansible.builtin.command: timedatectl show --property=NTPSynchronized --value
30+
register: sync_check
31+
until: sync_check.stdout | trim == "yes"
32+
retries: 60
33+
delay: 10
34+
failed_when: sync_check.rc != 0
2635
when: ntp_force_sync | bool
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
fixes:
3+
- |
4+
Reduces clock synchronisation race conditions before running Kolla by
5+
waiting for ``timedatectl`` to report ``NTPSynchronized=yes`` when
6+
``ntp_force_sync`` is enabled.
7+
8+
This improves reliability of deployments where services are sensitive to
9+
clock skew immediately after NTP configuration.

0 commit comments

Comments
 (0)