openshift-apps/koschei/job: Make sure previous jobs are deleted before creating new one
This commit is contained in:
parent
6cc4dd88b3
commit
45d728689c
1 changed files with 4 additions and 4 deletions
|
@ -3,11 +3,11 @@
|
||||||
src: "{{roles_path}}/openshift-apps/{{app}}/templates/job.yml"
|
src: "{{roles_path}}/openshift-apps/{{app}}/templates/job.yml"
|
||||||
dest: "/etc/openshift_apps/{{app}}/job-{{name}}.yml"
|
dest: "/etc/openshift_apps/{{app}}/job-{{name}}.yml"
|
||||||
|
|
||||||
|
- name: Delete previous job (if any)
|
||||||
|
shell: oc -n koschei delete --ignore-not-found=true -f /etc/openshift_apps/{{app}}/job-{{name}}.yml
|
||||||
|
|
||||||
- name: Start job
|
- name: Start job
|
||||||
shell: oc -n koschei apply -f /etc/openshift_apps/{{app}}/job-{{name}}.yml
|
shell: oc -n koschei create -f /etc/openshift_apps/{{app}}/job-{{name}}.yml
|
||||||
|
|
||||||
- name: Wait for job to complete
|
- name: Wait for job to complete
|
||||||
shell: oc -n koschei wait job/job-{{name}} --for condition=complete
|
shell: oc -n koschei wait job/job-{{name}} --for condition=complete
|
||||||
|
|
||||||
- name: Delete job
|
|
||||||
shell: oc -n koschei delete job/job-{{name}}
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue