From 3a34f2da8e3c16341ebd52c129a68db2cc317645 Mon Sep 17 00:00:00 2001 From: "Chris Hills @ Brsk Limited (GB)" <125888128+ChrisHills463@users.noreply.github.com> Date: Wed, 6 Dec 2023 09:26:24 +0000 Subject: [PATCH] Update install-with-package.yml Add a retry to the "Install Certbot." task which can fail if there is another process that has locked the package updater (e.g. `install 'certbot'' failed: E: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 11425 (unattended-upgr)`) --- tasks/install-with-package.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tasks/install-with-package.yml b/tasks/install-with-package.yml index 10490ff..674990d 100644 --- a/tasks/install-with-package.yml +++ b/tasks/install-with-package.yml @@ -1,6 +1,10 @@ --- - name: Install Certbot. package: "name={{ certbot_package }} state=present" + register: certbot_installed_ok + delay: 5 + retries: 5 + until: certbot_installed_ok is success - name: Set Certbot script variable. set_fact: