Files
fedora-infra_ansible/roles/openshift/object/tasks/main.yml
Patrick Uiterwijk 633c64b7d2 Only oc apply if the file changed
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
2018-04-19 17:35:26 +02:00

19 lines
1.0 KiB
YAML

- name: Copy template {{template}} to temporary file ({{tmpfile.path}})
template: src={{roles_path}}/openshift-apps/{{app}}/templates/{{template}} dest=/etc/openshift_apps/{{app}}/{{objectname}}
when: template is defined
register: object_template
- name: Copy template {{template_fullpath}} to temporary file ({{tmpfile.path}})
template: src={{template_fullpath}} dest=/etc/openshift_apps/{{app}}/{{objectname}}
when: template_fullpath is defined and template is not defined
register: object_template_fullpath
- name: Copy file {{file}} to temporary file ({{tmpfile.path}})
copy: src={{roles_path}}/openshift-apps/{{app}}/files/{{file}} dest=/etc/openshift_apps/{{app}}/{{objectname}}
when: file is defined and template is not defined and template_fullpath is not defined
register: object_file
- name: Call `oc apply` on the copied file
shell: oc -n {{app}} apply -f /etc/openshift_apps/{{app}}/{{objectname}}
when: object_template.changed or object_template_fullpath.changed or object_file.changed