Add chrony waitsync back in
This is a revert of 373a27163e because
makestep does not fail if the ntp servers are unavailable. This change
adds waitsync back in so it fails if the servers are unavilable but
leaves the makestep in place which should force the sync. If the
servers are unavailable, the waitsync should catch it. If they are
available waitsync should be a relative noop because the makestep would
sync the system. The waitsync has been increased to 5 minutes (from 200
seconds). waitsync will wait 30 times with an interval of 10 seconds
between checks.
Closes-Bug: #1955414
Change-Id: I4ac9210f6533e6826b2814f72b7271b43fdca267
This commit is contained in:
@@ -120,8 +120,10 @@ outputs:
|
|||||||
- name: Install, Configure and Run Chrony
|
- name: Install, Configure and Run Chrony
|
||||||
include_role:
|
include_role:
|
||||||
name: chrony
|
name: chrony
|
||||||
- name: Ensure system is NTP time synced
|
- name: Force NTP sync
|
||||||
command: chronyc makestep
|
command: chronyc makestep
|
||||||
|
- name: Ensure system is NTP time synced
|
||||||
|
command: chronyc waitsync 30
|
||||||
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}
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ resources:
|
|||||||
if [ "$service" = "chrony" ]; then
|
if [ "$service" = "chrony" ]; then
|
||||||
if command -v chronyc >/dev/null; then
|
if command -v chronyc >/dev/null; then
|
||||||
chronyc makestep
|
chronyc makestep
|
||||||
|
chronyc waitsync 30
|
||||||
else
|
else
|
||||||
echo "No chronyc available, skipping sync"
|
echo "No chronyc available, skipping sync"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user