From 231ddc06090e0606820d5c833654977736062c1c Mon Sep 17 00:00:00 2001 From: Francesco Pantano Date: Fri, 15 Nov 2024 15:21:48 +0100 Subject: [PATCH] Check if openstack user exists before trying to create it Signed-off-by: Francesco Pantano --- roles/cifmw_cephadm/tasks/post.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/roles/cifmw_cephadm/tasks/post.yml b/roles/cifmw_cephadm/tasks/post.yml index 9e71d03aca..3c88320c27 100644 --- a/roles/cifmw_cephadm/tasks/post.yml +++ b/roles/cifmw_cephadm/tasks/post.yml @@ -63,7 +63,16 @@ vars: ceph_command: "radosgw-admin" + - name: Check if Ceph user exists + ignore_errors: true + become: true + ansible.builtin.command: + cmd: >- + {{ cifmw_cephadm_ceph_cli }} user info --uid openstack + register: cifmw_ceph_s3_user + - name: Ceph rgw - create access/secret key + when: cifmw_ceph_s3_user.rc > 0 become: true ansible.builtin.command: cmd: >-