From cbaa2b57739f483b58d40dea3618b1630c576466 Mon Sep 17 00:00:00 2001 From: Chad Swenson Date: Wed, 6 Sep 2017 06:23:16 -0500 Subject: [PATCH] Retry Remove all Docker containers in reset (#1623) Due to various occasional docker bugs, removing a container will sometimes fail. This can often be mitigated by trying again. --- roles/reset/tasks/main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/roles/reset/tasks/main.yml b/roles/reset/tasks/main.yml index 26b6141dd..624e7135e 100644 --- a/roles/reset/tasks/main.yml +++ b/roles/reset/tasks/main.yml @@ -38,6 +38,10 @@ - name: reset | remove all containers shell: "{{ docker_bin_dir }}/docker ps -aq | xargs -r docker rm -fv" + register: remove_all_containers + retries: 4 + until: remove_all_containers.rc == 0 + delay: 5 tags: ['docker'] - name: reset | restart docker if needed