From c21f5d3b28f15a9872453f6968fdc91688f130ed Mon Sep 17 00:00:00 2001 From: Michal Arbet Date: Mon, 23 Dec 2024 01:44:43 +0100 Subject: [PATCH] Add retry mechanism to Ceph OSD addition task This change ensures the `Add OSDs individually` task is retried up to 3 times with a 10-second delay between attempts if the Ceph orchestrator command fails (non-zero return code). This enhances task resilience by allowing transient issues to resolve before marking the operation as failed. Resolves stackhpc/ansible-collection-cephadm#161 --- roles/cephadm/tasks/osds.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/roles/cephadm/tasks/osds.yml b/roles/cephadm/tasks/osds.yml index bb69137..925aaeb 100644 --- a/roles/cephadm/tasks/osds.yml +++ b/roles/cephadm/tasks/osds.yml @@ -20,3 +20,6 @@ # NOTE: Without this, the delegate hosts's ansible_host variable will not # be respected. ansible_host: "{{ mon_ansible_host if 'mons' in group_names else hostvars[groups['mons'][0]].ansible_host }}" + until: osd_add_result.rc == 0 + retries: 3 + delay: 10