Only create the keytab secret if it does not exist yet

Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
This commit is contained in:
Aurélien Bompard 2022-04-14 11:31:35 +02:00
parent 9bb04c8713
commit 4bd4158a6b
No known key found for this signature in database
GPG key ID: 31584CFEB9BF64AD

View file

@ -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"