--- - name: Check job uri: url: "{{ checkjobEndpoint }}" user: "{{ clusterUser }}" password: "{{ clusterPassword }}" method: GET validate_certs: no return_content: yes body_format: json force_basic_auth: yes register: jobresponse until: jobresponse.json.jobs[0].status != 'RUNNING' retries: 20 delay: 10 # - name: Report failure # fail: # msg: # - "{{ fail_message }}" # - "{{ jobresponse.json.jobs[0].result.stderr }}" # when: jobresponse.json.jobs[0].status == 'FAILED' # - name: Check job id and endpoint # debug: # msg: # - "{{ jobId }}" # - "{{ checkjobEndpoint }}" - name: Register dummy host with variable storage_fail add_host: name: "DUMMY_HOST" storage_fail: "{{ fail_message }}, API output {{ jobresponse.json.jobs[0].result.stderr }}" when: jobresponse.json.jobs[0].status == 'FAILED'