From 4bd4158a6b188cd76c5c031ccd8b24051bd75e5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Bompard?= Date: Thu, 14 Apr 2022 11:31:35 +0200 Subject: [PATCH] Only create the keytab secret if it does not exist yet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Aurélien Bompard --- roles/openshift/keytab/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/openshift/keytab/tasks/main.yml b/roles/openshift/keytab/tasks/main.yml index 7dbd66d783..1bb2190bc9 100644 --- a/roles/openshift/keytab/tasks/main.yml +++ b/roles/openshift/keytab/tasks/main.yml @@ -13,5 +13,5 @@ - name: Call `oc create secret generic` on the copied file shell: oc -n {{app}} create secret generic {{secret_name}} --from-file={{key}}=/etc/openshift_apps/{{app}}/{{key}}.kt register: create_out - when: ocp4 + when: ocp4 and not keytab_status.stat.exists failed_when: "create_out.rc != 0 and 'AlreadyExists' not in create_out.stderr"