actually put osbs_secret_files on the FS

Signed-off-by: Adam Miller <admiller@redhat.com>
This commit is contained in:
Adam Miller 2017-08-03 15:32:25 +00:00
parent dbac87c5f8
commit 099bd98b1b

View file

@ -1,34 +1,17 @@
--- ---
- set_fact: - name: place osbs_secret_files if they do not exist
osbs_secret_files_exist: true copy:
tags: src: "{{item.source}}"
- oc dest: "{{item.dest}}"
- set_fact:
osbs_secret_files_exist: false
when: lookup('file', lookup('first_found', [item.source, '/dev/null'])) == ''
with_items: "{{ osbs_secret_files }}" with_items: "{{ osbs_secret_files }}"
tags: tags:
- oc - oc
- fail:
msg: Some of the source secret files do not exist (and osbs_secret_can_fail is false)
when: not (osbs_secret_files_exist or osbs_secret_can_fail)
tags:
- oc
- debug:
msg: Some of the source secret files do not exist, skipping import
when: not osbs_secret_files_exist
tags:
- oc
- name: create secrets resource file - name: create secrets resource file
template: template:
src: openshift-secret.yml.j2 src: openshift-secret.yml.j2
dest: "{{ osbs_secret_remote_dir }}/openshift-secret-{{ inventory_hostname }}-{{ osbs_namespace }}-{{ osbs_secret_name }}.yml" dest: "{{ osbs_secret_remote_dir }}/openshift-secret-{{ inventory_hostname }}-{{ osbs_namespace }}-{{ osbs_secret_name }}.yml"
mode: "0600" mode: "0600"
when: osbs_secret_files_exist
notify: notify:
- import osbs secret - import osbs secret
- delete secret resource file - delete secret resource file