From 9425b147989d3b2e9f0819cc380bf906e29dabf9 Mon Sep 17 00:00:00 2001 From: Nathan Typanski Date: Thu, 3 Mar 2016 18:36:04 -0500 Subject: [PATCH] retry gpg key import GPG key import sometimes fail due to network partitions or errors on the remote server. Retry the GPG key import up to 5 times if this happens, so the playbook doesn't fail from temporary network issues. --- tasks/rvm.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tasks/rvm.yml b/tasks/rvm.yml index 05924d8..16c606a 100644 --- a/tasks/rvm.yml +++ b/tasks/rvm.yml @@ -32,6 +32,10 @@ when: rvm1_gpg_keys != '' become: yes become_user: '{{ rvm1_user }}' + register: result + until: result.rc == 0 + retries: 5 + delay: 5 - name: Install rvm command: >