Replace chronyc "waitsync" with "makestep"

Prior to this patch we had the "chrony waitsync" command with a
hardcoded timeout of "20". Sometimes that wasn't enough when deploying
on some slower machines in my experience [0].

This patch is changing the "waitsync" command to "makestep", that way
we tell chronyd to make the system clock correct immediately (instead
of gradually correcting the time). It should be fine for our usecase
because these are ran during the deployment.

[0] http://paste.openstack.org/show/783888/

Closes-bug: #1867362
Change-Id: I07057eb089585f43346c44a03ae50aa2ac837fd7
Signed-off-by: Lucas Alvares Gomes <lucasagomes@gmail.com>
(cherry picked from commit 373a27163e)
This commit is contained in:
Lucas Alvares Gomes
2019-10-15 11:23:29 +01:00
committed by David Vallee Delisle
parent d7b1bfe79d
commit 31c6b199b8
2 changed files with 2 additions and 2 deletions

View File

@@ -122,7 +122,7 @@ outputs:
- name: Ensure chrony has been restarted - name: Ensure chrony has been restarted
meta: flush_handlers meta: flush_handlers
- name: Ensure system is NTP time synced - name: Ensure system is NTP time synced
command: chronyc waitsync 20 command: chronyc makestep
ansible_group_vars: ansible_group_vars:
chrony_role_action: all chrony_role_action: all
chrony_ntp_servers: {get_param: NtpServer} chrony_ntp_servers: {get_param: NtpServer}

View File

@@ -74,7 +74,7 @@ resources:
set -x set -x
if [ "$service" = "chrony" ]; then if [ "$service" = "chrony" ]; then
if command -v chronyc >/dev/null; then if command -v chronyc >/dev/null; then
chronyc waitsync 20 chronyc makestep
else else
echo "No chronyc available, skipping sync" echo "No chronyc available, skipping sync"
fi fi