Skip to content

Commit b9167b8

Browse files
authored
Merge pull request #385 from stackhpc/upstream/master-2025-02-10
Synchronise master with upstream
2 parents 1787acd + 8dd0548 commit b9167b8

File tree

12 files changed

+59
-5
lines changed

12 files changed

+59
-5
lines changed

ansible/inventory/group_vars/all/time

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,17 @@ chrony_ntp_servers:
3838

3939
# Synchronise hardware clock with system time. Default is true.
4040
chrony_rtcsync_enabled: true
41+
42+
# Force synchronisation from NTP sources. This methods may jump the clock by
43+
# large values which can cause issues with some software. Disabled by default.
44+
ntp_force_sync: false
45+
46+
# Maximum number of tries used by the `chronyc waitsync` command. Only used
47+
# when ntp_force_sync is true. Default is 60 which waits for a maximum of 10
48+
# minutes (60 times 10 seconds).
49+
chrony_waitsync_max_tries: 60
50+
51+
# Maximum correction used by the `chronyc waitsync` command. Only used when
52+
# ntp_force_sync is true. Default is 0.01 which waits for the remaining
53+
# correction to be less than 10 milliseconds.
54+
chrony_waitsync_max_correction: 0.01

ansible/roles/ntp/tasks/sync.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
---
2+
# NOTE(priteau): We need to run handlers to restart chronyd before forcing
3+
# clock synchronisation, or the system clock could appear as not synchronised
4+
# during CI jobs because the tests run too quickly after the chronyd restart.
5+
- meta: flush_handlers
6+
27
- name: Force time synchronisation
38
become: True
49
block:
@@ -9,8 +14,7 @@
914
command: chronyc makestep
1015

1116
- name: Wait before hardware clock synchronisation
12-
pause:
13-
seconds: 5
17+
command: "chronyc waitsync {{ chrony_waitsync_max_tries }} {{ chrony_waitsync_max_correction }}"
1418

1519
- name: Ensure hwclock is installed
1620
package:

etc/kayobe/time.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,20 @@
3333
# Synchronise hardware clock with system time. Default is true.
3434
#chrony_rtcsync_enabled:
3535

36+
# Force synchronisation from NTP sources. This methods may jump the clock by
37+
# large values which can cause issues with some software. Disabled by default.
38+
#ntp_force_sync:
39+
40+
# Maximum number of tries used by the `chronyc waitsync` command. Only used
41+
# when ntp_force_sync is true. Default is 60 which waits for a maximum of 10
42+
# minutes (60 times 10 seconds).
43+
#chrony_waitsync_max_tries:
44+
45+
# Maximum correction used by the `chronyc waitsync` command. Only used when
46+
# ntp_force_sync is true. Default is 0.01 which waits for the remaining
47+
# correction to be less than 10 milliseconds.
48+
#chrony_waitsync_max_correction:
49+
3650
###############################################################################
3751
# Dummy variable to allow Ansible to accept this file.
3852
workaround_ansible_issue_8743: yes

playbooks/kayobe-infra-vm-base/overrides.yml.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ pip_upper_constraints_file: "/tmp/upper-constraints.txt"
1515
# QEMU.
1616
libvirt_vm_engine: "qemu"
1717

18+
# Force system clock synchronisation
19+
ntp_force_sync: True
20+
1821
# Use the CI infra's PyPI mirror.
1922
pip_local_mirror: true
2023
pip_index_url: "http://{{ zuul_site_mirror_fqdn }}/pypi/simple"

playbooks/kayobe-overcloud-base/overrides.yml.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ kolla_ansible_requirements_yml: "/tmp/kolla-ansible-requirements.yml"
1515
kolla_openstack_logging_debug: True
1616
pip_upper_constraints_file: "/tmp/upper-constraints.txt"
1717

18+
# Force system clock synchronisation
19+
ntp_force_sync: True
20+
1821
# Use the CI infra's PyPI mirror.
1922
pip_local_mirror: true
2023
pip_index_url: "http://{{ zuul_site_mirror_fqdn }}/pypi/simple"

playbooks/kayobe-overcloud-host-configure-base/overrides.yml.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,9 @@ chrony_ntp_servers:
196196
- option: maxsources
197197
val: 2
198198

199+
# Force system clock synchronisation
200+
ntp_force_sync: True
201+
199202
# Enable firewalld
200203
controller_firewalld_enabled: true
201204
controller_firewalld_zones:

playbooks/kayobe-overcloud-host-configure-base/tests/test_overcloud_host_configure.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,6 @@ def test_ntp_non_default_time_server(host):
204204
assert "time.cloudflare.com" in chrony_config.content_string
205205

206206

207-
# TODO(priteau): Remove once we force time sync
208-
@pytest.mark.skipif(_is_ubuntu_noble(),
209-
reason="Clock often fails to synchronize on Ubuntu Noble")
210207
def test_ntp_clock_synchronized(host):
211208
# Tests that the clock is synchronized
212209
status_output = host.check_output("timedatectl status")

playbooks/kayobe-overcloud-upgrade-base/overrides.yml.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ kolla_ansible_requirements_yml: "/tmp/previous-kolla-ansible-requirements.yml"
1919
{% endif %}
2020
kolla_openstack_logging_debug: true
2121

22+
# Force system clock synchronisation
23+
ntp_force_sync: True
24+
2225
# Use the CI infra's PyPI mirror.
2326
pip_local_mirror: true
2427
pip_index_url: "http://{{ zuul_site_mirror_fqdn }}/pypi/simple"

playbooks/kayobe-seed-base/overrides.yml.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ kolla_ansible_requirements_yml: "/tmp/kolla-ansible-requirements.yml"
1717
kolla_openstack_logging_debug: True
1818
pip_upper_constraints_file: "/tmp/upper-constraints.txt"
1919

20+
# Force system clock synchronisation
21+
ntp_force_sync: True
22+
2023
# Use the CI infra's PyPI mirror.
2124
pip_local_mirror: true
2225
pip_index_url: "http://{{ zuul_site_mirror_fqdn }}/pypi/simple"

playbooks/kayobe-seed-upgrade-base/overrides.yml.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ kolla_ansible_requirements_yml: "/tmp/previous-kolla-ansible-requirements.yml"
1919
{% endif %}
2020
kolla_openstack_logging_debug: True
2121

22+
# Force system clock synchronisation
23+
ntp_force_sync: True
24+
2225
# Use the CI infra's PyPI mirror.
2326
pip_local_mirror: true
2427
pip_index_url: "http://{{ zuul_site_mirror_fqdn }}/pypi/simple"

0 commit comments

Comments
 (0)