From 41dbe53bf4436a76efeaf1abfeca08960659a9c4 Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Thu, 14 Sep 2017 20:38:19 +0100 Subject: 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 --- xci/playbooks/roles/synchronize-time/tasks/main.yml | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'xci/playbooks') 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" -- cgit 1.2.3-korg