From e17f2b8df53127933cbcb57b0acd589800cb404f Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Sat, 9 Nov 2024 18:38:37 +0100 Subject: [PATCH] dd --- roles/mgrote_minio_configure/tasks/bucket.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/roles/mgrote_minio_configure/tasks/bucket.yml b/roles/mgrote_minio_configure/tasks/bucket.yml index be1cf144..9e1baaee 100644 --- a/roles/mgrote_minio_configure/tasks/bucket.yml +++ b/roles/mgrote_minio_configure/tasks/bucket.yml @@ -1,8 +1,12 @@ --- -- name: setup minio buckets - ansible.builtin.command: "{{ minio_client_bin }} --dp mb {{ minio_root_alias }}/{{ item.name }}" - loop: "{{ minio_buckets }}" - register: buckets - failed_when: > - (not "Your previous request to create the named bucket succeeded and you already own it." in buckets.stdout) or - (not buckets.rc == 0) +- name: block bucket + block: + - name: setup minio buckets + ansible.builtin.command: "{{ minio_client_bin }} --dp mb {{ minio_root_alias }}/{{ item.name }}" + loop: "{{ minio_buckets }}" + register: buckets + rescue: + - name: print x + ansible.builtin.debug: + msg: "bucket exists already" + when: 'not "Your previous request to create the named bucket succeeded and you already own it." in buckets.stdout'