This page provides a reference for the ansible.job.getStatus action available in the workflow automation actions catalog. Use this action to poll a job created by ansible.job.launch until it reaches a terminal state.
For prerequisites, see Ansible job actions.
Get the status of an Ansible job
The action identifier is ansible.job.getStatus.
Gets the status and details of an Automation Controller job. Job statuses progress from pending to waiting to running before reaching a terminal state: successful, failed, error, or canceled. The endpoint is GET https://{host}/api/controller/v2/jobs/{jobId}/.
The following table describes all available input fields for this action.
Input | Type | Description | Example |
|---|---|---|---|
host | String | Required. Hostname (and optional port) of the Automation Controller, without scheme. |
|
authToken | String | Required. OAuth2 token sent as |
|
jobId | Int | Required. Numeric job ID to poll. Typically the |
|
selectors | List | Optional. JQ selectors to extract specific fields from the action output. |
|
The following table describes all output fields returned by this action.
Output | Type | Description |
|---|---|---|
success | Boolean |
|
response | Object | Job details from the Automation Controller API. |
errorMessage | String | Error message on failure. |
The following example polls an Ansible job and branches on the result.
Workflow example |
|---|
|