Add chrony waitsync back in
This is a revert of373a27163e
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 (cherry picked from commit8d46c9c381
)
This commit is contained in:
parent
74f0072214
commit
fc293280c2
|
@ -122,8 +122,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
|
||||||
|
|
Loading…
Reference in New Issue