Add openshift/keytab

Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
This commit is contained in:
Patrick Uiterwijk 2018-04-17 01:22:18 +02:00
parent f82264261f
commit f81f5a943f

View file

@ -0,0 +1,17 @@
- name: Create temporary file
tempfile: state=file
register: tmpfile
run_once: true
- include_role: keytab/service
kt_location: "{{ tmpfile.path }}"
- name: Call `oc secrets new` on the copied file
shell: oc -n {{app}} secrets new {{secret_name}} {{key}}={{tmpfile.path}}
run_once: true
register: create_out
failed_when: "create_out.rc != 0 and 'AlreadyExists' not in create_out.stderr"
- name: Delete temporary file
file: path={{tmpfile.path}} state=absent
run_once: true