From 6258bdc3537ac2e4f0f4b2a0400cdb232d5a09e7 Mon Sep 17 00:00:00 2001 From: mkangia Date: Sat, 28 Dec 2024 00:05:19 +0530 Subject: [PATCH] add retries to account for restart/delays --- src/commcare_cloud/ansible/roles/couchdb2/tasks/main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/commcare_cloud/ansible/roles/couchdb2/tasks/main.yml b/src/commcare_cloud/ansible/roles/couchdb2/tasks/main.yml index fff8aa8662..7f27e4d66a 100644 --- a/src/commcare_cloud/ansible/roles/couchdb2/tasks/main.yml +++ b/src/commcare_cloud/ansible/roles/couchdb2/tasks/main.yml @@ -92,6 +92,10 @@ status_code: 201, 409 # 409 means already set up (conflict) body: '{}' when: inventory_hostname == groups.couchdb2.0 and item != groups.couchdb2.0 + register: result + until: not result.failed or 'Connection refused' not in result.msg + retries: 5 + delay: 10 with_items: "{{ groups.couchdb2 }}" tags: - add_couch_nodes