wait for job to complete

This commit is contained in:
Sascha Marcel Schmidt 2018-07-08 13:16:25 +02:00
parent 318c69350e
commit 306a6a751f
No known key found for this signature in database
GPG key ID: D1D6CE184437796D

View file

@ -15,6 +15,8 @@
- "heketi_storage_state.stdout|from_json|json_query(endpoints_query)|length == 0" - "heketi_storage_state.stdout|from_json|json_query(endpoints_query)|length == 0"
- "heketi_storage_state.stdout|from_json|json_query(service_query)|length == 0" - "heketi_storage_state.stdout|from_json|json_query(service_query)|length == 0"
- "heketi_storage_state.stdout|from_json|json_query(job_query)|length == 0" - "heketi_storage_state.stdout|from_json|json_query(job_query)|length == 0"
register: "heketi_storage_result"
- debug: { var: "heketi_storage_result" }
- command: "kubectl get secrets,endpoints,services,jobs --output=json" - command: "kubectl get secrets,endpoints,services,jobs --output=json"
register: "heketi_storage_state" register: "heketi_storage_state"
- name: "Get state of heketi storage service, endpoint, secret and job." - name: "Get state of heketi storage service, endpoint, secret and job."
@ -25,7 +27,7 @@
secret_query: "items[?metadata.name=='heketi-storage-secret' && kind=='Secret']" secret_query: "items[?metadata.name=='heketi-storage-secret' && kind=='Secret']"
endpoints_query: "items[?metadata.name=='heketi-storage-endpoints' && kind=='Endpoints']" endpoints_query: "items[?metadata.name=='heketi-storage-endpoints' && kind=='Endpoints']"
service_query: "items[?metadata.name=='heketi-storage-endpoints' && kind=='Service']" service_query: "items[?metadata.name=='heketi-storage-endpoints' && kind=='Service']"
job_query: "items[?metadata.name=='heketi-storage-copy-job' && kind=='Job' && status.active==0]" job_query: "items[?metadata.name=='heketi-storage-copy-job' && kind=='Job' && status.conditions[?type=='Complete'].status=='True']"
until: until:
- "heketi_storage_state.stdout|from_json|json_query(secret_query)|length == 1" - "heketi_storage_state.stdout|from_json|json_query(secret_query)|length == 1"
- "heketi_storage_state.stdout|from_json|json_query(endpoints_query)|length == 1" - "heketi_storage_state.stdout|from_json|json_query(endpoints_query)|length == 1"