From db0e57251fa039be3ee349257dfe3061be0aa991 Mon Sep 17 00:00:00 2001 From: Eric Engstrom Date: Tue, 20 Apr 2021 16:47:20 -0500 Subject: [PATCH] Retry `docker` package installation at least once. Why: when a previous installation was removed, but left behind service configurations, and the docker service is disabled, package installation will occasionally fail the first time. --- tasks/main.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tasks/main.yml b/tasks/main.yml index dd90c22..b051620 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -9,6 +9,13 @@ package: name: "{{ docker_package }}" state: "{{ docker_package_state }}" + # RETRY - when a previous installation was removed, but left behind service + # configurations, and the docker service is disabled, package installation + # will occasionally fail the first time, at least under Ubuntu 18.04. + retries: 2 + delay: 2 + register: install_result + until: install_result is not failed notify: restart docker - name: Ensure Docker is started and enabled at boot.