summaryrefslogtreecommitdiffstats
path: root/xci/playbooks/roles/synchronize-time/tasks/main.yml
diff options
context:
space:
mode:
authorMarkos Chandras <mchandras@suse.de>2017-09-14 20:38:19 +0100
committerMarkos Chandras <mchandras@suse.de>2017-09-14 20:38:19 +0100
commit41dbe53bf4436a76efeaf1abfeca08960659a9c4 (patch)
treed48d3bf07773ed1c6aed5e41a8c23c33c2596107 /xci/playbooks/roles/synchronize-time/tasks/main.yml
parent0229646cf9676fec855bd0de195d9dc4a7a9873b (diff)
synchronize-time: Retry if chrony failed due to NTP issues
chrony randomly fails with the following issue TASK [synchronize-time : synchronize time] ************************************* fatal: [controller00]: FAILED! => {"changed": true, "cmd": "chronyc -a 'burst 4/4' && chronyc -a makestep", "delta": "0:00:00.004991", "end": "2017-09-14 19:30:37.561972", "failed": true, "rc": 1, "start": "2017-09-14 19:30:37.556981", "stderr": "", "stdout": "200 OK\n503 No such source", "stdout_lines": ["200 OK", "503 No such source"],"warnings": []} As such, lets retry a few more times before giving up. Change-Id: I20767bb3031061c03c9ba8dbc65859c7312bfac9 Signed-off-by: Markos Chandras <mchandras@suse.de>
Diffstat (limited to 'xci/playbooks/roles/synchronize-time/tasks/main.yml')
-rw-r--r--xci/playbooks/roles/synchronize-time/tasks/main.yml4
1 files changed, 4 insertions, 0 deletions
diff --git a/xci/playbooks/roles/synchronize-time/tasks/main.yml b/xci/playbooks/roles/synchronize-time/tasks/main.yml
index 5c39d897..985c1515 100644
--- a/xci/playbooks/roles/synchronize-time/tasks/main.yml
+++ b/xci/playbooks/roles/synchronize-time/tasks/main.yml
@@ -15,4 +15,8 @@
state: restarted
- name: synchronize time
shell: "chronyc -a 'burst 4/4' && chronyc -a makestep"
+ register: chrony_got_time
+ until: chrony_got_time.rc == 0
+ retries: 5
+ delay: 5
when: ansible_distribution_release == "xenial"