wait for job to complete

pull/2931/head
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
1 changed files with 3 additions and 1 deletions

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(service_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"
register: "heketi_storage_state"
- 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']"
endpoints_query: "items[?metadata.name=='heketi-storage-endpoints' && kind=='Endpoints']"
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:
- "heketi_storage_state.stdout|from_json|json_query(secret_query)|length == 1"
- "heketi_storage_state.stdout|from_json|json_query(endpoints_query)|length == 1"