From e58660e8bccec93b11b3c0280606f6daf58b1dda Mon Sep 17 00:00:00 2001 From: denmat <694767+denmat@users.noreply.github.com> Date: Fri, 31 May 2019 19:31:38 +1000 Subject: [PATCH] Add retries to package installs (#88) * Add retry guard around package installs to avoid locking Both YUM and APT consistently display temporary locking when building via packer and ansible * retry usually only fires once anecdotally * Changing to make style consistent with other roles --- tasks/install.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tasks/install.yml b/tasks/install.yml index a490e2b..4bbc46a 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -3,6 +3,10 @@ package: name: "{{ item }}" state: present + register: _install_dep_packages + until: _install_dep_packages is success + retries: 5 + delay: 2 with_items: "{{ node_exporter_dependencies }}" - name: Create the node_exporter group