This page provides a reference for the ansible.job.launch action available in the workflow automation actions catalog. Use this action to launch an Ansible Automation Platform (Automation Controller) job template from a workflow step.
For prerequisites, see Ansible job actions.
Launch an Ansible job template
The action identifier is ansible.job.launch.
Launches an Ansible Automation Platform (Automation Controller) job template and returns the created job. On success, returns a job id you can use with ansible.job.getStatus to poll the job until it reaches a terminal state. The endpoint is POST https://{host}/api/controller/v2/job_templates/{jobTemplateId}/launch/.
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 |
|
jobTemplateId | Int | Required. Numeric ID of the job template to launch. |
|
extraVars | Map | Optional. Extra variables passed as |
|
limit | String | Optional. Ansible host pattern passed as |
|
inventory | String | Optional. Numeric inventory ID overriding the template default. Requires |
|
jobTags | String | Optional. Comma-separated tags passed as |
|
skipTags | String | Optional. Comma-separated tags to skip, passed as |
|
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 | The created job object. Use the |
errorMessage | String | Error message on failure. |
The following example launches an Ansible job template and captures the job ID for polling.
Workflow example |
|---|
|