From 4db92dae5954d29d2688168a1131c011db43cf73 Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Mon, 12 Apr 2021 22:29:50 +0200 Subject: [PATCH] rbdmirror: add retries/until when configuring mirroring `configure_mirroring.yml` is called right after the daemon is started. Sometimes, it can happen the first task in `configure_mirroring.yml` is run while the daemon isn't yet ready, adding a retries/until on that task should help to avoid causing the playbook to fail. Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1944996 Signed-off-by: Guillaume Abrioux (cherry picked from commit b1e7e1ad0f517c345ade159961d8bb2cb13b1c22) --- roles/ceph-rbd-mirror/tasks/configure_mirroring.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/roles/ceph-rbd-mirror/tasks/configure_mirroring.yml b/roles/ceph-rbd-mirror/tasks/configure_mirroring.yml index 34f25ca8a..4eec1d7a2 100644 --- a/roles/ceph-rbd-mirror/tasks/configure_mirroring.yml +++ b/roles/ceph-rbd-mirror/tasks/configure_mirroring.yml @@ -1,7 +1,11 @@ --- - name: enable mirroring on the pool command: "{{ container_exec_cmd | default('') }} rbd --cluster {{ cluster }} --keyring /etc/ceph/{{ cluster }}.client.rbd-mirror.{{ ansible_facts['hostname'] }}.keyring --name client.rbd-mirror.{{ ansible_facts['hostname'] }} mirror pool enable {{ ceph_rbd_mirror_pool }} {{ ceph_rbd_mirror_mode }}" + register: result changed_when: false + retries: 90 + delay: 1 + until: result is succeeded - name: list mirroring peer command: "{{ container_exec_cmd | default('') }} rbd --cluster {{ cluster }} --keyring /etc/ceph/{{ cluster }}.client.rbd-mirror.{{ ansible_facts['hostname'] }}.keyring --name client.rbd-mirror.{{ ansible_facts['hostname'] }} mirror pool info {{ ceph_rbd_mirror_pool }}"