From 42b81e264ef1bff36634749c3160286439f78bfe Mon Sep 17 00:00:00 2001 From: Matthew Mosesohn Date: Mon, 13 Mar 2017 15:11:27 +0300 Subject: [PATCH] Retry docker save in case it errors --- roles/download/tasks/main.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/roles/download/tasks/main.yml b/roles/download/tasks/main.yml index b4eb79053..fcdabc9a2 100644 --- a/roles/download/tasks/main.yml +++ b/roles/download/tasks/main.yml @@ -130,6 +130,9 @@ shell: "{{ docker_bin_dir }}/docker save {{ pull_args }} | gzip -{{ download_compress }} > {{ fname }}" delegate_to: "{{ download_delegate }}" register: saved + until: saved|success and "Error" not in saved.stderr + retries: 4 + delay: "{{ retry_stagger | random + 3 }}" run_once: true when: (not ansible_os_family in ["CoreOS", "Container Linux by CoreOS"] or download_delegate == "localhost") and download_run_once|bool and download.enabled|bool and download.container|bool and (container_changed|bool or not img.stat.exists)