Skip to main content

Ansible Automation Platform

This Integration is part of the Ansible Automation Platform Pack.#

Scale IT automation, manage complex deployments, and speed productivity. This integration was integrated and tested with version v3.8.0 of Ansible Automation Platform and with API version v2.

Configure Ansible Automation Platform on Cortex XSOAR#

  1. Navigate to Settings > Integrations > Servers & Services.

  2. Search for Ansible Automation Platform.

  3. Click Add instance to create and configure a new integration instance.

    ParameterDescriptionRequired
    urlServer URLTrue
    credentialsUsernameTrue
    insecureTrust any certificate (not secure)False
    proxyUse system proxy settingsFalse
  4. Click Test to validate the URLs, token, and connection.

Commands#

You can execute these commands from the Cortex XSOAR CLI, as part of an automation, or in a playbook. After you successfully execute a command, a DBot message appears in the War Room with the command details.

ansible-tower-inventories-list#


Retrieves the list of inventories.

Base Command#

ansible-tower-inventories-list

Input#

Argument NameDescriptionRequired
idThe inventory ID for which to retrieve the specific inventory.Optional
page_numberPage number to retrieve. Default is 1.Optional
page_sizePage size. Default is 50.Optional
searchThe search query string used to perform a case-insensitive search within all designated text fields of a model.Optional

Context Output#

PathTypeDescription
AnsibleAWX.Inventory.idNumberDatabase ID for this inventory.
AnsibleAWX.Inventory.typeStringData type for this inventory.
AnsibleAWX.Inventory.urlStringURL for this inventory.
AnsibleAWX.Inventory.createdDateTimestamp indicating when this inventory was created.
AnsibleAWX.Inventory.modifiedDateTimestamp indicating when this inventory was last modified.
AnsibleAWX.Inventory.nameStringName of this inventory.
AnsibleAWX.Inventory.descriptionStringOptional description of this inventory.
AnsibleAWX.Inventory.organizationNumberID of the organization containing this inventory.
AnsibleAWX.Inventory.kindStringType of inventory being represented.
AnsibleAWX.Inventory.host_filterStringFilter that is applied to the hosts of this inventory.
AnsibleAWX.Inventory.variablesStringInventory variables in JSON or YAML format.
AnsibleAWX.Inventory.total_inventory_sourcesNumberTotal number of external inventory sources configured within this inventory.
AnsibleAWX.Inventory.inventory_sources_with_failuresNumberNumber of external inventory sources in this inventory with failures.
AnsibleAWX.Inventory.insights_credentialNumberCredentials to be used by hosts belonging to this inventory when accessing Red Hat Insights API.
AnsibleAWX.Inventory.pending_deletionBooleanFlag indicating the inventory is being deleted.

Command Example#

!ansible-tower-inventories-list page_number=1 page_size=50

Context Example#

{
"AnsibleAWX": {
"Inventory": {
"created": "2019-11-19 11:53:43.325946",
"description": "",
"groups_with_active_failures": 0,
"host_filter": null,
"id": 1,
"insights_credential": null,
"inventory_sources_with_failures": 0,
"kind": "",
"modified": "2021-01-11 10:41:31.234370",
"name": "Example Inventory",
"organization": 1,
"pending_deletion": false,
"total_inventory_sources": 0,
"type": "inventory",
"url": "/api/v2/inventories/1/",
"variables": ""
}
}
}

Human Readable Output#

Inventories List#

nameidtypeurlcreatedmodifiedorganizationgroups_with_active_failurestotal_inventory_sourcesinventory_sources_with_failurespending_deletion
Example Inventory1inventory/api/v2/inventories/1/2019-11-19 11:53:43.3259462021-01-11 10:41:31.2343701000false

ansible-tower-hosts-list#


Retrieves the list of hosts. If an inventory ID is specified, retrieve the host located under the specific inventory.

Base Command#

ansible-tower-hosts-list

Input#

Argument NameDescriptionRequired
host_idID of the host to retrieve.Optional
inventory_idID of the inventory to retrieve.Optional
pagePage number to retrieve. Default is 1.Optional
page_sizePage size. Default is 50.Optional
searchThe search query string used to perform a case-insensitive search within all designated text fields of a model.Optional

Context Output#

PathTypeDescription
AnsibleAWX.Host.idNumberDatabase ID for this host.
AnsibleAWX.Host.typeStringData type for this host.
AnsibleAWX.Host.urlStringURL for this host.
AnsibleAWX.Host.createdDateTimestamp indicating when this host was created.
AnsibleAWX.Host.modifiedDateTimestamp indicating when this host was last modified.
AnsibleAWX.Host.nameStringName of this host.
AnsibleAWX.Host.descriptionStringOptional description of this host.
AnsibleAWX.Host.inventoryNumberInventory ID.
AnsibleAWX.Host.enabledBooleanWhether this host is online and available for running jobs.
AnsibleAWX.Host.instance_idStringThe value used by the remote inventory source to uniquely identify the host.
AnsibleAWX.Host.variablesStringHost variables in JSON or YAML format.
AnsibleAWX.Host.last_jobNumberID of the last job that was run on the host.
AnsibleAWX.Host.insights_system_idStringRed Hat Insights host unique identifier.
AnsibleAWX.Host.ansible_facts_modifiedDateThe date and time ansible_facts was last modified.

Command Example#

!ansible-tower-hosts-list inventory_id=1

Context Example#

{
"AnsibleAWX": {
"Host": [
{
"ansible_facts_modified": null,
"created": "2021-01-07 11:42:29.655768",
"description": "",
"enabled": true,
"id": 1,
"insights_system_id": null,
"instance_id": "",
"inventory": 1,
"last_job": 700,
"modified": "2021-01-13 07:46:49.267924",
"name": "test",
"type": "host",
"url": "/api/v2/hosts/1/",
"variables": ""
}
]
}
}

Human Readable Output#

Hosts List#

nameidtypeurlcreatedmodifiedinventoryenabledvariableslast_job
test1host/api/v2/hosts/1/2021-01-07 11:42:29.6557682021-01-13 07:46:49.2679241true700

ansible-tower-host-create#


Creates a host under the specified inventory ID and with the specified name.

Base Command#

ansible-tower-host-create

Input#

Argument NameDescriptionRequired
inventory_idThe ID of the inventory under which to create the host.Required
host_nameUnique name for the host.Required
descriptionOptional description of this host.Optional
enabledWhether this host will be online and available for running jobs. Default is "True". Default is True.Optional

Context Output#

PathTypeDescription
AnsibleAWX.Host.idNumberDatabase ID for this host.
AnsibleAWX.Host.typeStringData type for this host.
AnsibleAWX.Host.urlStringURL for this host.
AnsibleAWX.Host.createdDateTimestamp indicating when this host was created.
AnsibleAWX.Host.modifiedDateTimestamp indicating when this host was last modified.
AnsibleAWX.Host.nameStringName of this host.
AnsibleAWX.Host.descriptionStringOptional description of this host.
AnsibleAWX.Host.inventoryNumberInventory ID.
AnsibleAWX.Host.enabledBooleanWhether this host is online and available for running jobs.
AnsibleAWX.Host.instance_idStringThe value used by the remote inventory source to uniquely identify the host.
AnsibleAWX.Host.variablesStringHost variables in JSON or YAML format.
AnsibleAWX.Host.has_active_failuresBooleanWhether host has active failures.
AnsibleAWX.Host.last_jobNumberThe ID of the last job.
AnsibleAWX.Host.insights_system_idStringRed Hat Insights host unique identifier.
AnsibleAWX.Host.ansible_facts_modifiedDateThe date and time ansible_facts was last modified.

Command Example#

!ansible-tower-host-create host_name=example inventory_id=1

Context Example#

{
"AnsibleAWX": {
"Host": {
"ansible_facts_modified": null,
"created": "2021-01-14 09:22:01.427258",
"description": "",
"enabled": true,
"id": 3,
"insights_system_id": null,
"instance_id": "",
"inventory": 1,
"last_job": null,
"modified": "2021-01-14 09:22:01.427272",
"name": "example",
"type": "host",
"url": "/api/v2/hosts/3/",
"variables": ""
}
}
}

Human Readable Output#

Created Host#

nameidenabledinventorymodifiedcreatedtypeurl
example3true12021-01-14 09:22:01.4272722021-01-14 09:22:01.427258host/api/v2/hosts/3/

ansible-tower-host-delete#


Deletes the specified host.

Base Command#

ansible-tower-host-delete

Input#

Argument NameDescriptionRequired
host_idThe ID of the host to delete.Required

Context Output#

PathTypeDescription
AnsibleAWX.Host.idNumberDatabase ID for this host.
AnsibleAWX.Host.DeletedBooleanWhether this host was deleted.

Command Example#

!ansible-tower-host-delete host_id=30

Human Readable Output#

Removed host id: 30

ansible-tower-job-templates-list#


Retrieves the list of job templates.

Base Command#

ansible-tower-job-templates-list

Input#

Argument NameDescriptionRequired
inventory_idInventory ID of the jobs that are managed with hosts under this inventory.Optional
pagePage number to retrieve. Default is 1.Optional
page_sizePage size. Default is 50.Optional
searchThe search query string used to perform a case-insensitive search within all designated text fields of a model.Optional
idThe ID of the job template.Optional

Context Output#

PathTypeDescription
AnsibleAWX.JobTemplate.idNumberDatabase ID for this job template.
AnsibleAWX.JobTemplate.typeStringData type for this job template.
AnsibleAWX.JobTemplate.urlStringURL for this job template.
AnsibleAWX.JobTemplate.createdDateTimestamp indicating when this job template was created.
AnsibleAWX.JobTemplate.modifiedDateTimestamp indicating when this job template was last modified.
AnsibleAWX.JobTemplate.nameStringName of this job template.
AnsibleAWX.JobTemplate.descriptionStringOptional description of this job template.
AnsibleAWX.JobTemplate.job_typeStringJob type. Possible values are "run" and "check".
AnsibleAWX.JobTemplate.inventoryNumberInventory ID.
AnsibleAWX.JobTemplate.projectNumberProject ID.
AnsibleAWX.JobTemplate.playbookStringPlaybook name.
AnsibleAWX.JobTemplate.limitStringThe host pattern that will limit the list of hosts that will be managed or affected by the playbook.
AnsibleAWX.JobTemplate.extra_varsStringExtra command line variables that were passed to the playbook.
AnsibleAWX.JobTemplate.job_tagsStringJob tags. These tags are useful when you have a large playbook and you want to run a specific part of a playbook or task.
AnsibleAWX.JobTemplate.skip_tagsStringSkip tags. These tags are useful when you have a large playbook and you want to skip a specific part of a playbook or task.
AnsibleAWX.JobTemplate.timeoutNumberThe number of seconds to wait before the task is canceled.
AnsibleAWX.JobTemplate.last_job_runDateTimestamp indicating when the last job ran.
AnsibleAWX.JobTemplate.last_job_failedBooleanWhether the last job failed.
AnsibleAWX.JobTemplate.next_job_runDateTimestamp of the next job run.
AnsibleAWX.JobTemplate.statusStringStatus of the job. Can be new, pending, waiting, running, successful, failed, error, canceled, or never updated.
AnsibleAWX.JobTemplate.host_config_keyStringThe host config key that ran the job.
AnsibleAWX.JobTemplate.survey_enabledBooleanWhether the job template survey was enabled.
AnsibleAWX.JobTemplate.become_enabledBooleanWhether the job template was enabled.
AnsibleAWX.JobTemplate.custom_virtualenvStringLocal absolute file path containing a custom Python virtualenv to use.
AnsibleAWX.JobTemplate.credentialNumberCredential ID that allowed Tower to access the node this job was run against.

Command Example#

!ansible-tower-job-templates-list

Context Example#

{
"AnsibleAWX": {
"JobTemplate": {
"become_enabled": false,
"created": "2019-11-19 11:53:43.446968",
"credential": 1,
"custom_virtualenv": null,
"description": "",
"extra_vars": "",
"host_config_key": "",
"id": 5,
"inventory": 1,
"job_tags": "",
"job_type": "run",
"last_job_failed": true,
"last_job_run": "2021-01-13T07:46:49.418371Z",
"limit": "",
"modified": "2021-01-13 07:46:49.462160",
"name": "Demo Job Template",
"next_job_run": null,
"playbook": "hello_world.yml",
"project": 4,
"skip_tags": "",
"status": "failed",
"survey_enabled": false,
"timeout": 0,
"type": "job_template",
"url": "/api/v2/job_templates/5/",
"vault_credential": null
}
}
}

Human Readable Output#

Job Templates List#

nameidtypeurlcreatedmodifiedinventoryprojectplaybooktimeoutlast_job_runlast_job_failedstatussurvey_enabledbecome_enabledcredential
Demo Job Template5job_template/api/v2/job_templates/5/2019-11-19 11:53:43.4469682021-01-13 07:46:49.462160run14hello_world.yml02021-01-13T07:46:49.418371Ztruefailedfalsefalse

ansible-tower-credentials-list#


Retrieves the list of credentials. If an ID is specified, retrieve the specific credential.

Base Command#

ansible-tower-credentials-list

Input#

Argument NameDescriptionRequired
idID of a specific credential.Optional
pagePage number to retrieve. Default is 1.Optional
page_sizePage size. Default is 50.Optional
searchThe search query string used to perform a case-insensitive search within all designated text fields of a model.Optional

Context Output#

PathTypeDescription
AnsibleAWX.Credential.idNumberDatabase ID for this credential.
AnsibleAWX.Credential.typeStringData type for this credential.
AnsibleAWX.Credential.urlStringURL for this credential.
AnsibleAWX.Credential.createdDateTimestamp indicating when this credential was created.
AnsibleAWX.Credential.modifiedDateTimestamp indicating when this credential was last modified.
AnsibleAWX.Credential.nameStringName of this credential.
AnsibleAWX.Credential.descriptionStringOptional description of this credential.
AnsibleAWX.Credential.organizationNumberOrganization ID. Inherits permissions from organization roles.
AnsibleAWX.Credential.credential_typeNumberThe type of credential to create.
AnsibleAWX.Credential.inputs.usernameStringUsername.

Command Example#

!ansible-tower-credentials-list

Context Example#

{
"AnsibleAWX": {
"Credential": {
"created": "2019-11-19 11:53:43.220855",
"credential_type": 1,
"description": "",
"id": 1,
"inputs": {
"username": "admin"
},
"modified": "2019-11-19 11:53:43.289192",
"name": "Demo Credential",
"organization": null,
"type": "credential",
"url": "/api/v2/credentials/1/"
}
}
}

Human Readable Output#

Credentials List#

nameidtypeurlcreatedmodifiedcredential_typeinputs
Demo Credential1credential/api/v2/credentials/1/2019-11-19 11:53:43.2208552019-11-19 11:53:43.2891921username: admin

ansible-tower-job-launch#


Launches the job template.

Base Command#

ansible-tower-job-launch

Input#

Argument NameDescriptionRequired
job_template_idID of the job template to launch.Required
inventory_idThe ID of the inventory that contains the host you want this job to manage if the job template does not have an inventory to start.Optional
credentials_idThe ID of the credentials that allow Tower to access the node this job will be run against.Optional
extra_variablesCommand line variables to pass to the playbook in JSON format.Optional

Context Output#

PathTypeDescription
AnsibleAWX.Job.idNumberDatabase ID for this job.
AnsibleAWX.Job.typeStringData type for this job.
AnsibleAWX.Job.urlStringURL for this job.
AnsibleAWX.Job.createdDateTimestamp indicating when this job was created.
AnsibleAWX.Job.modifiedDateTimestamp indicating when this job was last modified.
AnsibleAWX.Job.nameStringName of this job.
AnsibleAWX.Job.descriptionStringOptional description of this job.
AnsibleAWX.Job.job_typeStringJob type. Possible values are "run" and "check".
AnsibleAWX.Job.inventoryNumberInventory ID.
AnsibleAWX.Job.projectNumberProject ID.
AnsibleAWX.Job.playbookStringPlaybook name.
AnsibleAWX.Job.limitStringThe host pattern that will limit the list of hosts that will be managed or affected by the playbook.
AnsibleAWX.Job.extra_varsStringExtra command line variables that were passed to the playbook.
AnsibleAWX.Job.job_tagsStringJob tags. These tags are useful when you have a large playbook and you want to run a specific part of a playbook or task.
AnsibleAWX.Job.skip_tagsStringSkip tags. These tags are useful when you have a large playbook and you want to skip a specific part of a playbook or task.
AnsibleAWX.Job.timeoutNumberThe number of seconds to wait before the task is canceled.
AnsibleAWX.Job.launch_typeStringLaunch type of the job. Can be manual, relaunch, callback, scheduled, dependency, workflow, webhook, sync, or scm.
AnsibleAWX.Job.statusStringStatus of the job. Can be new, pending, waiting, running, successful, failed, error, canceled, or never updated.
AnsibleAWX.Job.failedBooleanWhether the job failed.
AnsibleAWX.Job.startedDateThe date and time the job was queued to start.
AnsibleAWX.Job.finishedDateThe date and time the job finished execution.
AnsibleAWX.Job.job_argsStringJob arguments.
AnsibleAWX.Job.elapsedNumberThe amount of time in seconds that it took the job to run.
AnsibleAWX.Job.job_cwdStringCurrent working directory (CWD) of the job.
AnsibleAWX.Job.job_explanationStringIndicates the state of the job if it was not able to run and capture the standard output
AnsibleAWX.Job.execution_nodeStringThe node the job executed on.
AnsibleAWX.Job.controller_nodeStringThe instance that managed the isolated execution environment.
AnsibleAWX.Job.result_tracebackStringThe traceback of the result.
AnsibleAWX.Job.job_templateNumberThe ID of the job template for this job.
AnsibleAWX.Job.scm_revisionStringThe source control management revision of the project used for this job, if available.
AnsibleAWX.Job.instance_groupNumberThe instance group the job was run under.
AnsibleAWX.Job.credentialNumberCredential ID that allowed Tower to access the node this job was run against.

Command Example#

!ansible-tower-job-launch job_template_id=5

Context Example#

{
"AnsibleAWX": {
"Job": {
"artifacts": {},
"controller_node": "",
"created": "2021-01-14 09:22:07.965061",
"credential": 1,
"description": "",
"elapsed": 0,
"execution_node": "",
"extra_vars": "{}",
"failed": false,
"finished": null,
"id": 1,
"ignored_fields": {},
"instance_group": null,
"inventory": 1,
"job_args": "",
"job_cwd": "",
"job_explanation": "",
"job_tags": "",
"job_template": 5,
"job_type": "run",
"launch_type": "manual",
"limit": "",
"modified": "2021-01-14 09:22:08.080092",
"name": "Example Job Template",
"passwords_needed_to_start": [],
"playbook": "hello_world.yml",
"project": 4,
"result_traceback": "",
"scm_revision": "",
"skip_tags": "",
"started": null,
"status": "pending",
"timeout": 0,
"type": "job",
"url": "/api/v2/jobs/1/",
"vault_credential": null
}
}
}

Human Readable Output#

Job: 1 status is: pending#

nameidtypeurlcreatedmodifiedjob_typeinventoryprojectplaybookextra_varstimeoutlaunch_typestatusfailedelapsedjob_templatecredential
Example Job Template1job/api/v2/jobs/1/2021-01-14 09:22:07.9650612021-01-14 09:22:08.080092run14hello_world.yml{}0manualpendingfalse0.051

ansible-tower-job-relaunch#


Relaunch a job.

Base Command#

ansible-tower-job-relaunch

Input#

Argument NameDescriptionRequired
job_idID of the job to relaunch.Required
relaunch_hostsThe hosts to relaunch the job. Can be all the hosts or only the ones where the job failed. Possible values are: "all" and "failed". Default is "all". Possible values are: all, failed. Default is all.Optional
credentials_idCredential ID.Optional

Context Output#

PathTypeDescription
AnsibleAWX.Job.idNumberDatabase ID for this job.
AnsibleAWX.Job.typeStringData type for this job.
AnsibleAWX.Job.urlStringURL for this job.
AnsibleAWX.Job.elapsedNumberThe amount of time in seconds that it took the job to run.
AnsibleAWX.Job.createdDateTimestamp indicating when this job was created.
AnsibleAWX.Job.modifiedDateTimestamp indicating when this job was last modified.
AnsibleAWX.Job.nameStringName of this job.
AnsibleAWX.Job.descriptionStringOptional description of this job.
AnsibleAWX.Job.job_typeStringJob type. Possible values are "run" and "check".
AnsibleAWX.Job.inventoryNumberInventory ID.
AnsibleAWX.Job.projectNumberProject ID
AnsibleAWX.Job.playbookStringPlaybook name
AnsibleAWX.Job.limitStringThe host pattern that will limit the list of hosts that will be managed or affected by the playbook.
AnsibleAWX.Job.extra_varsStringExtra command line variables that were passed to the playbook.
AnsibleAWX.Job.job_tagsStringJob tags. These tags are useful when you have a large playbook and you want to run a specific part of a playbook or task.
AnsibleAWX.Job.skip_tagsStringSkip tags. These tags are useful when you have a large playbook and you want to skip a specific part of a playbook or task.
AnsibleAWX.Job.timeoutNumberThe number of seconds to wait before the task is canceled.
AnsibleAWX.Job.launch_typeStringLaunch type of the job. Can be manual, relaunch, callback, scheduled, dependency, workflow, webhook, sync, or scm.
AnsibleAWX.Job.statusStringStatus of the job. Can be new, pending, waiting, running, successful, failed, error, canceled, or never updated.
AnsibleAWX.Job.failedBooleanWhether the job failed.
AnsibleAWX.Job.startedDateThe date and time the job was queued to start.
AnsibleAWX.Job.finishedDateThe date and time the job finished execution.
AnsibleAWX.Job.job_argsStringJob arguments.
AnsibleAWX.Job.job_cwdStringCurrent working directory (CWD) of the job.
AnsibleAWX.Job.job_explanationStringIndicates the state of the job if it was not able to run and capture the standard output
AnsibleAWX.Job.execution_nodeStringThe node the job executed on.
AnsibleAWX.Job.controller_nodeStringThe instance that managed the isolated execution environment.
AnsibleAWX.Job.result_tracebackStringThe traceback of the result.
AnsibleAWX.Job.job_templateNumberThe ID of the job template of this job.
AnsibleAWX.Job.scm_revisionStringThe source control management revision of the project used for this job, if available.
AnsibleAWX.Job.instance_groupNumberThe instance group the job was run under.
AnsibleAWX.Job.credentialNumberCredential ID that allowed Tower to access the node this job was run against.

Command Example#

!ansible-tower-job-relaunch job_id=1

Context Example#

{
"AnsibleAWX": {
"Job": {
"artifacts": {},
"controller_node": "",
"created": "2021-01-14 09:22:09.688907",
"credential": 1,
"description": "",
"elapsed": 0,
"execution_node": "",
"extra_vars": "{}",
"failed": false,
"finished": null,
"id": 2,
"instance_group": null,
"inventory": 1,
"job_args": "",
"job_cwd": "",
"job_explanation": "",
"job_tags": "",
"job_template": 5,
"job_type": "run",
"launch_type": "relaunch",
"limit": "",
"modified": "2021-01-14 09:22:09.841300",
"name": "Example Job Template",
"passwords_needed_to_start": [],
"playbook": "hello_world.yml",
"project": 4,
"result_traceback": "",
"scm_revision": "",
"skip_tags": "",
"started": null,
"status": "pending",
"timeout": 0,
"type": "job",
"url": "/api/v2/jobs/2/",
"vault_credential": null
}
}
}

Human Readable Output#

ansible-tower-job-cancel#


Cancels a pending or running job.

Base Command#

ansible-tower-job-cancel

Input#

Argument NameDescriptionRequired
job_idThe ID of the job to cancel.Required

Context Output#

PathTypeDescription
AnsibleAWX.Job.idNumberDatabase ID for this job.
AnsibleAWX.Job.typeStringData type for this job.
AnsibleAWX.Job.urlStringURL for this job.
AnsibleAWX.Job.createdDateTimestamp indicating when this job was created.
AnsibleAWX.Job.modifiedDateTimestamp indicating when this job was last modified.
AnsibleAWX.Job.nameStringName of this job.
AnsibleAWX.Job.descriptionStringOptional description of this job.
AnsibleAWX.Job.job_typeStringJob type. Possible values are "run" and "check".
AnsibleAWX.Job.inventoryNumberInventory ID.
AnsibleAWX.Job.projectNumberProject ID.
AnsibleAWX.Job.playbookStringPlaybook name.
AnsibleAWX.Job.limitStringThe host pattern that will limit the list of hosts that will be managed or affected by the playbook.
AnsibleAWX.Job.extra_varsStringExtra command line variables that were passed to the playbook.
AnsibleAWX.Job.job_tagsStringJob tags. These tags are useful when you have a large playbook and you want to run a specific part of a playbook or task.
AnsibleAWX.Job.skip_tagsStringSkip tags. These tags are useful when you have a large playbook and you want to skip a specific part of a playbook or task.
AnsibleAWX.Job.timeoutNumberThe number of seconds to wait before the task is canceled.
AnsibleAWX.Job.launch_typeStringLaunch type of the job. Can be manual, relaunch, callback, scheduled, dependency, workflow, webhook, sync, or scm.
AnsibleAWX.Job.statusStringStatus of the job. Can be new, pending, waiting, running, successful, failed, error, canceled, or never updated.
AnsibleAWX.Job.failedBooleanWhether the job failed.
AnsibleAWX.Job.startedDateThe date and time the job was queued to start.
AnsibleAWX.Job.finishedDateThe date and time the job finished execution.
AnsibleAWX.Job.elapsedNumberThe amount of time in seconds that it took the job to run.
AnsibleAWX.Job.job_argsStringJob arguments.
AnsibleAWX.Job.job_cwdStringCurrent working directory (CWD) of the job.
AnsibleAWX.Job.job_explanationStringIndicates the state of the job if it was not able to run and capture the standard output.
AnsibleAWX.Job.execution_nodeStringThe node the job executed on.
AnsibleAWX.Job.controller_nodeStringThe instance that managed the isolated execution environment.
AnsibleAWX.Job.result_tracebackStringThe traceback of the result.
AnsibleAWX.Job.job_templateNumberThe ID of the job template of this job.
AnsibleAWX.Job.scm_revisionStringThe source control management revision of the project used for this job, if available.
AnsibleAWX.Job.instance_groupNumberThe instance group the job was run under.
AnsibleAWX.Job.credentialNumberCredential ID that allowed Tower to access the node this job was run against.

Command Example#

!ansible-tower-job-cancel job_id=2

Context Example#

{
"AnsibleAWX": {
"Job": {
"artifacts": {},
"controller_node": "",
"created": "2021-01-14 12:11:11.430693",
"credential": 1,
"description": "",
"elapsed": 0,
"execution_node": "",
"extra_vars": "{}",
"failed": true,
"finished": "2021-01-14T12:11:17.297156Z",
"id": 2,
"instance_group": null,
"inventory": 1,
"job_args": "",
"job_cwd": "",
"job_explanation": "",
"job_tags": "",
"job_template": 5,
"job_type": "run",
"launch_type": "manual",
"limit": "",
"modified": "2021-01-14 12:11:17.297511",
"name": "Example Job Template",
"passwords_needed_to_start": [],
"playbook": "hello_world.yml",
"project": 4,
"result_traceback": "",
"scm_revision": "",
"skip_tags": "",
"started": null,
"status": "canceled",
"timeout": 0,
"type": "job",
"url": "/api/v2/jobs/2/",
"vault_credential": null
}
}
}

Human Readable Output#

Job 2 status canceled#

nameidtypeurlcreatedmodifiedjob_typeinventoryprojectplaybookextra_varstimeoutlaunch_typestatusfailedfinishedelapsedjob_templatecredential
Example Job Template2job/api/v2/jobs/2/2021-01-14 12:11:11.4306932021-01-14 12:11:17.297511run14hello_world.yml{}0manualcanceledtrue2021-01-14T12:11:17.297156Z0.051

ansible-tower-job-stdout#


Retrieves the standard output by running the provided job.

Base Command#

ansible-tower-job-stdout

Input#

Argument NameDescriptionRequired
job_idThe ID of the job.Required
print_outputWhether to print the output. Possible values are: "True" and "False". Default is "True". Possible values are: True, False. Default is True.Optional
text_filterThe string by which to filter lines in the standard output. For example, enter 'success' to filter the standard output lines containing this word.Optional

Context Output#

PathTypeDescription
AnsibleAWX.JobStdout.job_idNumberThe ID of the job.
AnsibleAWX.JobStdout.contentStringThe standard output content.

Command Example#

!ansible-tower-job-stdout job_id=3

Context Example#

{
"AnsibleAWX": {
"JobStdout": {
"content": "\n\nPLAY [Hello World Sample] ******************************************************\n\nTASK [Gathering Facts] *********************************************************\n\u001b[1;31mfatal: [check8]: UNREACHABLE! => {\"changed\": false, \"msg\": \"Failed to connect to the host via ssh: ssh: Could not resolve hostname check8: Name or service not known\\\\r\\\\n\", \"unreachable\": true}\u001b[0m\n\u001b[0;32mok: [localhost]\u001b[0m\n\nTASK [Hello Message] ***********************************************************\n\u001b[0;32mok: [localhost] => {\u001b[0m\n\u001b[0;32m \"msg\": \"Hello World!\"\u001b[0m\n\u001b[0;32m}\u001b[0m\n\nPLAY RECAP *********************************************************************\n\u001b[0;31mcheck8\u001b[0m : ok=0 changed=0 \u001b[1;31munreachable=1 \u001b[0m failed=0 \n\u001b[0;32mlocalhost\u001b[0m : \u001b[0;32mok=2 \u001b[0m changed=0 unreachable=0 failed=0 \n\n",
"job_id": "3"
}
}
}

Human Readable Output#

Job 3 output#

PLAY [Hello World Sample] **

TASK [Gathering Facts] * fatal: [check8]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: ssh: Could not resolve hostname check8: Name or service not known\r\n", "unreachable": true} ok: [localhost]

TASK [Hello Message] *** ok: [localhost] => {  "msg": "Hello World!" }

PLAY RECAP * check8 : ok=0 changed=0 unreachable=1  failed=0
localhost : ok=2  changed=0 unreachable=0 failed=0

ansible-tower-job-status#


Retrieves the job status.

Base Command#

ansible-tower-job-status

Input#

Argument NameDescriptionRequired
job_idThe ID of the job.Required
searchThe search query string used to perform a case-insensitive search within all designated text fields of a model.Optional

Context Output#

PathTypeDescription
AnsibleAWX.Job.idNumberDatabase ID for this job.
AnsibleAWX.Job.typeStringData type for this job.
AnsibleAWX.Job.urlStringURL for this job.
AnsibleAWX.Job.createdDateTimestamp indicating when this job was created.
AnsibleAWX.Job.modifiedDateTimestamp indicating when this job was last modified.
AnsibleAWX.Job.nameStringName of this job.
AnsibleAWX.Job.descriptionStringOptional description of this job.
AnsibleAWX.Job.job_typeStringJob type. Possible values are "run" and "check".
AnsibleAWX.Job.inventoryNumberInventory ID.
AnsibleAWX.Job.projectNumberProject ID.
AnsibleAWX.Job.playbookStringPlaybook name.
AnsibleAWX.Job.limitStringThe host pattern that will limit the list of hosts that will be managed or affected by the playbook.
AnsibleAWX.Job.extra_varsStringExtra command line variables that were passed to the playbook.
AnsibleAWX.Job.job_tagsStringJob tags. These tags are useful when you have a large playbook and you want to run a specific part of a playbook or task.
AnsibleAWX.Job.skip_tagsStringSkip tags. These tags are useful when you have a large playbook and you want to skip a specific part of a playbook or task.
AnsibleAWX.Job.timeoutNumberThe number of seconds to wait before the task is canceled.
AnsibleAWX.Job.launch_typeStringLaunch type of the job. Can be manual, relaunch, callback, scheduled, dependency, workflow, webhook, sync, or scm.
AnsibleAWX.Job.statusStringStatus of the job. Can be new, pending, waiting, running, successful, failed, error, canceled, or never updated.
AnsibleAWX.Job.failedBooleanWhether the job failed.
AnsibleAWX.Job.startedDateThe date and time the job was queued to start.
AnsibleAWX.Job.finishedDateThe date and time the job finished execution.
AnsibleAWX.Job.elapsedNumberThe amount of time in seconds that it took the job to run.
AnsibleAWX.Job.job_argsStringJob arguments.
AnsibleAWX.Job.job_cwdStringCurrent working directory (CWD) of the job.
AnsibleAWX.Job.job_explanationStringIndicates the state of the job if it was not able to run and capture the standard output.
AnsibleAWX.Job.execution_nodeStringThe node the job executed on.
AnsibleAWX.Job.controller_nodeStringThe instance that managed the isolated execution environment.
AnsibleAWX.Job.result_tracebackStringThe traceback of the result.
AnsibleAWX.Job.job_templateNumberThe ID of the job template of this job.
AnsibleAWX.Job.scm_revisionStringThe source control management revision of the project used for this job, if available.
AnsibleAWX.Job.instance_groupNumberThe instance group the job was run under.
AnsibleAWX.Job.credentialNumberCredential ID that allowed Tower to access the node this job was run against.

Command Example#

!ansible-tower-job-status job_id=2

Context Example#

{
"AnsibleAWX": {
"Job": {
"artifacts": {},
"controller_node": "",
"created": "2020-12-30 16:12:05.529479",
"credential": 1,
"description": "",
"elapsed": 0,
"execution_node": "",
"extra_vars": "{}",
"failed": true,
"finished": "2020-12-30T16:12:08.434925Z",
"id": 2,
"instance_group": null,
"inventory": 1,
"job_args": "",
"job_cwd": "",
"job_explanation": "",
"job_tags": "",
"job_template": 5,
"job_type": "run",
"launch_type": "manual",
"limit": "",
"modified": "2020-12-30 16:12:08.435262",
"name": "Demo Job Template",
"passwords_needed_to_start": [],
"playbook": "hello_world.yml",
"project": 4,
"result_traceback": "",
"scm_revision": "",
"skip_tags": "",
"started": null,
"status": "canceled",
"timeout": 0,
"type": "job",
"url": "/api/v2/jobs/2/",
"vault_credential": null
}
}
}

Human Readable Output#

Job 2 status failed#

nameidtypeurlcreatedmodifiedjob_typeinventoryprojectplaybookextra_varstimeoutlaunch_typestatusfailedfinishedelapsedjob_templatecredential
Demo Job Template2job/api/v2/jobs/2/2020-12-30 16:12:05.5294792020-12-30 16:12:08.435262run14hello_world.yml{}0manualfailedtrue2020-12-30T16:12:08.434925Z0.051

ansible-tower-job-events-list#


Retrieves the list of job events.

Base Command#

ansible-tower-job-events-list

Input#

Argument NameDescriptionRequired
idThe ID of the job event.Optional
pageThe page number to retrieve. Default is 1.Optional
page_sizePage size. Default is 50.Optional
searchThe search query string used to perform a case-insensitive search within all designated text fields of a model.Optional

Context Output#

PathTypeDescription
AnsibleAWX.JobEvents.idNumberDatabase ID for this job event.
AnsibleAWX.JobEvents.typeStringData type for this job event.
AnsibleAWX.JobEvents.urlStringURL for this job event.
AnsibleAWX.JobEvents.createdDateTimestamp indicating when this job event was created.
AnsibleAWX.JobEvents.modifiedDateTimestamp indicating when this job event was last modified.
AnsibleAWX.JobEvents.jobNumberJob ID.
AnsibleAWX.JobEvents.eventStringThe specific event. For example, runner_on_failed (Host Failed), runner_on_start (Host Started), etc.
AnsibleAWX.JobEvents.counterNumberJob event counter.
AnsibleAWX.JobEvents.event_displayStringEvent display. For example, Playbook Started.
AnsibleAWX.JobEvents.event_levelNumberThe event level.
AnsibleAWX.JobEvents.failedBooleanWhether the job failed.
AnsibleAWX.JobEvents.changedBooleanWhether the job changed.
AnsibleAWX.JobEvents.uuidStringUUID of the job event.
AnsibleAWX.JobEvents.parent_uuidStringParent UUID.
AnsibleAWX.JobEvents.hostNumberHost ID associated with the event.
AnsibleAWX.JobEvents.host_nameStringHost name associated with the event.
AnsibleAWX.JobEvents.playbookStringPlaybook name of this job.
AnsibleAWX.JobEvents.taskStringTask name.
AnsibleAWX.JobEvents.stdoutStringStandard output of the job.
AnsibleAWX.JobEvents.start_lineNumberStarting line number of the execution.
AnsibleAWX.JobEvents.end_lineNumberEnding line number of the execution.

Command Example#

!ansible-tower-job-events-list

Context Example#

{
"AnsibleAWX": {
"JobEvents": [
{
"changed": false,
"counter": 1,
"created": "2020-12-20 15:27:19.104059",
"end_line": 0,
"event": "playbook_on_start",
"event_display": "Playbook Started",
"event_level": 0,
"failed": false,
"host": null,
"host_name": "",
"id": 1,
"modified": "2020-12-20 15:27:19.137215",
"parent_uuid": "",
"playbook": "hello_world.yml",
"start_line": 0,
"stdout": "",
"task": "",
"type": "job_event",
"url": "/api/v2/job_events/1/",
"uuid": "331e9ca5-56e2-4c2e-b77c-40fef9b95502"
}
]
}
}

Human Readable Output#

Results#

typeidurlcreatedmodifiedeventcounterevent_displayevent_levelfailedchangeduuidparent_uuidhosthost_nameplaybooktaskstdoutstart_lineend_line
job_event1/api/v2/job_events/1/2020-12-20 15:27:19.1040592020-12-20 15:27:19.137215playbook_on_start1Playbook Started0falsefalse331e9ca5-56e2-4c2e-b77c-40fef9b95502hello_world.yml00

ansible-tower-adhoc-command-launch#


Creates new ad hoc commands.

Base Command#

ansible-tower-adhoc-command-launch

Input#

Argument NameDescriptionRequired
inventory_idID of the inventory.Required
credential_idID of the credential.Required
module_nameThe name of the module.Modules are discrete units of code that can be used from the command line or in a playbook task. Ansible ships with a number of modules that can be executed directly on remote hosts or through playbooks. Possible values are: command, shell, yum, apt, apt_key, apt_repository, apt_rpm, service, group, user, mount, ping, selinux, setup, win_ping, win_service, win_updates, win_group, win_user.Required
module_argsModule arguments.Optional

Context Output#

PathTypeDescription
AnsibleAWX.AdhocCommand.idNumberDatabase ID for this ad hoc command.
AnsibleAWX.AdhocCommand.typeStringData type for this ad hoc command.
AnsibleAWX.AdhocCommand.urlStringURL for this ad hoc command.
AnsibleAWX.AdhocCommand.createdDateTimestamp indicating when this ad hoc command was created.
AnsibleAWX.AdhocCommand.modifiedDateTimestamp indicating when this ad hoc command was last modified.
AnsibleAWX.AdhocCommand.nameStringName of this ad hoc command.
AnsibleAWX.AdhocCommand.launch_typeStringLaunch type of the job. Can be manual, relaunch, callback, scheduled, dependency, workflow, webhook, sync, or scm.
AnsibleAWX.AdhocCommand.statusStringStatus of the job. Can be new, pending, waiting, running, successful, failed, error, canceled, or never updated.
AnsibleAWX.AdhocCommand.failedBooleanWhether the job failed.
AnsibleAWX.AdhocCommand.startedDateThe date and time the job was queued to start.
AnsibleAWX.AdhocCommand.finishedDateThe date and time the job finished execution.
AnsibleAWX.AdhocCommand.elapsedNumberThe amount of time in seconds that it took the job to run.
AnsibleAWX.AdhocCommand.job_explanationStringIndicates the state of the job if it was not able to run and capture the standard output.
AnsibleAWX.AdhocCommand.execution_nodeStringThe node the job executed on.
AnsibleAWX.AdhocCommand.controller_nodeStringThe instance that managed the isolated execution environment.
AnsibleAWX.AdhocCommand.job_typeStringJob type. Possible values are "run" and "check".
AnsibleAWX.AdhocCommand.inventoryNumberInventory ID.
AnsibleAWX.AdhocCommand.limitStringThe host pattern that will limit the list of hosts that will be managed or affected by the playbook.
AnsibleAWX.AdhocCommand.credentialNumberCredential ID that allowed Tower to access the node this job was run against.
AnsibleAWX.AdhocCommand.module_nameStringSelected module name.
AnsibleAWX.AdhocCommand.module_argsStringModule arguments.
AnsibleAWX.AdhocCommand.extra_varsStringExtra variables needed for the module running.
AnsibleAWX.AdhocCommand.become_enabledBooleanWhether the ad hoc command become enabled.

Command Example#

!ansible-tower-adhoc-command-launch credential_id=1 inventory_id=1 module_name=ping

Context Example#

{
"AnsibleAWX": {
"AdhocCommand": {
"become_enabled": false,
"controller_node": "",
"created": "2021-01-14 09:22:18.554364",
"credential": 1,
"elapsed": 0,
"execution_node": "",
"extra_vars": "",
"failed": false,
"finished": null,
"id": 1,
"inventory": 1,
"job_explanation": "",
"job_type": "run",
"launch_type": "manual",
"limit": "",
"modified": "2021-01-14 09:22:18.585043",
"module_args": "",
"module_name": "ping",
"name": "ping",
"started": null,
"status": "new",
"type": "ad_hoc_command",
"url": "/api/v2/ad_hoc_commands/1/"
}
}
}

Human Readable Output#

Ad hoc command - 1 status - new#

nameidtypeurlcreatedmodifiedlaunch_typestatusfailedelapsedjob_typeinventorycredentialmodule_namebecome_enabled
ping1ad_hoc_command/api/v2/ad_hoc_commands/1/2021-01-14 09:22:18.5543642021-01-14 09:22:18.585043manualnewfalse0.0run11pingfalse

ansible-tower-adhoc-command-relaunch#


Launch a new job to run the ad hoc command.

Base Command#

ansible-tower-adhoc-command-relaunch

Input#

Argument NameDescriptionRequired
command_idThe ID of the command.Required

Context Output#

PathTypeDescription
AnsibleAWX.AdhocCommand.idNumberDatabase ID for this ad hoc command.
AnsibleAWX.AdhocCommand.typeStringData type for this ad hoc command.
AnsibleAWX.AdhocCommand.urlStringURL for this ad hoc command.
AnsibleAWX.AdhocCommand.createdDateTimestamp indicating when this ad hoc command was created.
AnsibleAWX.AdhocCommand.modifiedDateTimestamp indicating when this ad hoc command was last modified.
AnsibleAWX.AdhocCommand.nameStringName of this ad hoc command.
AnsibleAWX.AdhocCommand.launch_typeStringLaunch type. Can be manual, relaunch, callback, scheduled, dependency, workflow, webhook, sync, or scm.
AnsibleAWX.AdhocCommand.statusStringStatus. Can be new, pending, waiting, running, successful, failed, error, canceled, or never updated.
AnsibleAWX.AdhocCommand.failedBooleanWhether the job failed.
AnsibleAWX.AdhocCommand.startedDateThe date and time the job was queued to start.
AnsibleAWX.AdhocCommand.finishedDateThe date and time the job finished execution.
AnsibleAWX.AdhocCommand.elapsedNumberThe amount of time in seconds that it took the job to run.
AnsibleAWX.AdhocCommand.job_explanationStringIndicates the state of the job if it was not able to run and capture the standard output.
AnsibleAWX.AdhocCommand.execution_nodeStringThe node the job executed on
AnsibleAWX.AdhocCommand.controller_nodeStringThe instance that managed the isolated execution environment.
AnsibleAWX.AdhocCommand.job_typeStringJob type. Possible values are "run" and "check".
AnsibleAWX.AdhocCommand.inventoryNumberInventory ID.
AnsibleAWX.AdhocCommand.limitStringThe host pattern that will limit the list of hosts that will be managed or affected by the playbook.
AnsibleAWX.AdhocCommand.credentialNumberCredential ID that allowed Tower to access the node this job was run against.
AnsibleAWX.AdhocCommand.module_nameStringSelected module name.
AnsibleAWX.AdhocCommand.module_argsStringModule arguments.
AnsibleAWX.AdhocCommand.extra_varsStringExtra variables needed for that module running.
AnsibleAWX.AdhocCommand.become_enabledBooleanWhether the ad hoc command become enabled.

Command Example#

!ansible-tower-adhoc-command-relaunch command_id=1

Context Example#

{
"AnsibleAWX": {
"AdhocCommand": {
"ad_hoc_command": 2,
"become_enabled": false,
"controller_node": "",
"created": "2021-01-14 09:22:20.700721",
"credential": 1,
"elapsed": 0,
"execution_node": "",
"extra_vars": "",
"failed": false,
"finished": null,
"id": 2,
"inventory": 1,
"job_args": "",
"job_cwd": "",
"job_explanation": "",
"job_type": "run",
"launch_type": "manual",
"limit": "",
"modified": "2021-01-14 09:22:20.748133",
"module_args": "",
"module_name": "ping",
"name": "ping",
"result_traceback": "",
"started": null,
"status": "pending",
"type": "ad_hoc_command",
"url": "/api/v2/ad_hoc_commands/2/"
}
}
}

Human Readable Output#

Ad hoc command - 2 status - pending#

nameidtypeurlcreatedmodifiedlaunch_typestatusfailedelapsedjob_typeinventorycredentialmodule_namebecome_enabledad_hoc_command
ping2ad_hoc_command/api/v2/ad_hoc_commands/2/2021-01-14 09:22:20.7007212021-01-14 09:22:20.748133manualpendingfalse0.0run11pingfalse2

ansible-tower-adhoc-command-cancel#


Cancel a job of the specified ad hoc command.

Base Command#

ansible-tower-adhoc-command-cancel

Input#

Argument NameDescriptionRequired
command_idThe ID of the command to cancel.Required

Context Output#

PathTypeDescription
AnsibleAWX.AdhocCommand.idNumberDatabase ID for this ad hoc command.
AnsibleAWX.AdhocCommand.typeStringData type for this ad hoc command.
AnsibleAWX.AdhocCommand.urlStringURL for this ad hoc command.
AnsibleAWX.AdhocCommand.createdDateTimestamp indicating when this ad hoc command was created.
AnsibleAWX.AdhocCommand.modifiedDateTimestamp indicating when this ad hoc command was last modified.
AnsibleAWX.AdhocCommand.nameStringName of this ad hoc command.
AnsibleAWX.AdhocCommand.launch_typeStringLaunch type. Can be manual, relaunch, callback, scheduled, dependency, workflow, webhook, sync, or scm.
AnsibleAWX.AdhocCommand.statusStringStatus. Can be new, pending, waiting, running, successful, failed, error, canceled, or never updated.
AnsibleAWX.AdhocCommand.failedBooleanWhether the job failed.
AnsibleAWX.AdhocCommand.startedNoneThe date and time the job was queued to start.
AnsibleAWX.AdhocCommand.finishedDateThe date and time the job finished execution.
AnsibleAWX.AdhocCommand.elapsedNumberThe amount of time in seconds that it took the job to run.
AnsibleAWX.AdhocCommand.job_argsStringJob arguments.
AnsibleAWX.AdhocCommand.job_cwdStringCurrent working directory (CWD) of the job.
AnsibleAWX.AdhocCommand.job_explanationStringIndicates the state of the job if it was not able to run and capture the standard output.
AnsibleAWX.AdhocCommand.execution_nodeStringThe node the job executed on.
AnsibleAWX.AdhocCommand.controller_nodeStringThe instance that managed the isolated execution environment.
AnsibleAWX.AdhocCommand.result_tracebackStringThe traceback of the result.
AnsibleAWX.AdhocCommand.job_typeStringJob type. Possible values are "run" and "check".
AnsibleAWX.AdhocCommand.inventoryNumberInventory ID.
AnsibleAWX.AdhocCommand.limitStringThe host pattern that will limit the list of hosts that will be managed or affected by the playbook.
AnsibleAWX.AdhocCommand.credentialNumberCredential ID that allowed Tower to access the node this job was run against.
AnsibleAWX.AdhocCommand.module_nameStringSelected module name.
AnsibleAWX.AdhocCommand.module_argsStringModule arguments.
AnsibleAWX.AdhocCommand.extra_varsStringExtra variables needed for that module running.
AnsibleAWX.AdhocCommand.become_enabledBooleanWhether the ad hoc command become enabled.

Command Example#

!ansible-tower-adhoc-command-cancel command_id=2

Context Example#

{
"AnsibleAWX": {
"AdhocCommand": {
"become_enabled": false,
"controller_node": "",
"created": "2021-01-14 12:21:28.382292",
"credential": 1,
"elapsed": 2.280328,
"execution_node": "awx",
"extra_vars": "",
"failed": true,
"finished": "2021-01-14 12:21:28.668796",
"id": 2,
"inventory": 1,
"job_args": "[]",
"job_cwd": "",
"job_explanation": "",
"job_type": "run",
"launch_type": "manual",
"limit": "",
"modified": "2021-01-14 12:21:30.557684",
"module_args": "",
"module_name": "ping",
"name": "ping",
"result_traceback": "",
"started": "2021-01-14T12:21:28.668796Z",
"status": "canceled",
"type": "ad_hoc_command",
"url": "/api/v2/ad_hoc_commands/2/"
}
}
}

Human Readable Output#

Ad hoc command - 2 status - canceled#

nameidtypeurlcreatedmodifiedlaunch_typestatusfailedstartedelapsedjob_argsjob_cwdexecution_nodejob_typeinventorycredentialmodule_namebecome_enabled
ping2ad_hoc_command/api/v2/ad_hoc_commands/2/2021-01-14 12:21:28.3822922021-01-14 12:21:30.557684manualcanceledfalse2021-01-14T12:21:28.668796Z2.280328[]awxrun11pingfalse

ansible-tower-adhoc-command-stdout#


Retrieves the standard output from running this ad hoc command.

Base Command#

ansible-tower-adhoc-command-stdout

Input#

Argument NameDescriptionRequired
command_idThe ID of the command to run.Required
print_outputPrints the ad hoc command output. Possible values are: "True" and "False". Default is "True". Possible values are: True, False. Default is True.Optional
text_filterThe string by which to filter lines in the standard output. For example, enter 'success' to filter the standard output lines containing this word.Optional

Context Output#

PathTypeDescription
AnsibleAWX.AdhocCommandStdout.contentStringStandard output content.

Command Example#

!ansible-tower-adhoc-command-stdout command_id=1

Context Example#

{
"AnsibleAWX": {
"AdhocCommandStdout": {
"command_id": "1",
"content": "\u001b[1;31mteat_demo | UNREACHABLE! => {\u001b[0m\n\u001b[1;31m \"changed\": false, \u001b[0m\n\u001b[1;31m \"msg\": \"Failed to connect to the host via ssh: ssh: Could not resolve hostname teat_demo: Name or service not known\\\\r\\\\n\", \u001b[0m\n\u001b[1;31m \"unreachable\": true\u001b[0m\n\u001b[1;31m}\u001b[0m\n\u001b[0;32mlocalhost | SUCCESS => {\u001b[0m\n\u001b[0;32m \"changed\": false, \u001b[0m\n\u001b[0;32m \"ping\": \"pong\"\u001b[0m\n\u001b[0;32m}\u001b[0m\n\n"
}
}
}

Human Readable Output#

Ad hoc command 1 output#

 test_demo | UNREACHABLE! => {  "changed": false,   "msg": "Failed to connect to the host via ssh: ssh: Could not resolve hostname teat_demo: Name or service not known",   "unreachable": true }

ansible-tower-adhoc-command-status#


Retrieves a single ad hoc command status.

Base Command#

ansible-tower-adhoc-command-status

Input#

Argument NameDescriptionRequired
command_idThe ID of the command.Required

Context Output#

PathTypeDescription
AnsibleAWX.AdhocCommand.idNumberDatabase ID for this ad hoc command.
AnsibleAWX.AdhocCommand.typeStringData type for this ad hoc command.
AnsibleAWX.AdhocCommand.urlStringURL for this ad hoc command.
AnsibleAWX.AdhocCommand.createdDateTimestamp indicating when this ad hoc command was created.
AnsibleAWX.AdhocCommand.modifiedDateTimestamp indicating when this ad hoc command was last modified.
AnsibleAWX.AdhocCommand.nameStringName of this ad hoc command.
AnsibleAWX.AdhocCommand.launch_typeStringLaunch type. Can be manual, relaunch, callback, scheduled, dependency, workflow, webhook, sync, or scm.
AnsibleAWX.AdhocCommand.statusStringStatus. Can be new, pending, waiting, running, successful, failed, error, canceled, or never updated.
AnsibleAWX.AdhocCommand.failedBooleanWhether the job failed.
AnsibleAWX.AdhocCommand.startedDateThe date and time the job was queued to start.
AnsibleAWX.AdhocCommand.finishedDateThe date and time the job finished execution.
AnsibleAWX.AdhocCommand.elapsedNumberThe amount of time in seconds that it took the job to run.
AnsibleAWX.AdhocCommand.job_argsStringJob arguments.
AnsibleAWX.AdhocCommand.job_cwdStringCurrent working directory (CWD) of the job.
AnsibleAWX.AdhocCommand.job_explanationStringIndicates the state of the job if it was not able to run and capture the standard output.
AnsibleAWX.AdhocCommand.execution_nodeStringThe node the job executed on.
AnsibleAWX.AdhocCommand.controller_nodeStringThe instance that managed the isolated execution environment.
AnsibleAWX.AdhocCommand.result_tracebackStringThe traceback of the result.
AnsibleAWX.AdhocCommand.job_typeStringJob type. Possible values are "run" and "check".
AnsibleAWX.AdhocCommand.inventoryNumberInventory ID.
AnsibleAWX.AdhocCommand.limitStringThe host pattern that will limit the list of hosts that will be managed or affected by the playbook.
AnsibleAWX.AdhocCommand.credentialNumberCredential ID that allowed Tower to access the node this job was run against.
AnsibleAWX.AdhocCommand.module_nameStringSelected module name.
AnsibleAWX.AdhocCommand.module_argsStringModule arguments.
AnsibleAWX.AdhocCommand.extra_varsStringExtra variables needed for that module running.
AnsibleAWX.AdhocCommand.become_enabledBooleanWhether the ad hoc command become enabled.

Command Example#

!ansible-tower-adhoc-command-status command_id=1

Context Example#

{
"AnsibleAWX": {
"AdhocCommand": {
"become_enabled": false,
"controller_node": "",
"created": "2020-12-29 13:28:21.538400",
"credential": 1,
"elapsed": 2.2,
"execution_node": "awx",
"extra_vars": "",
"failed": true,
"finished": "2020-12-29T13:28:24.029843Z",
"id": 1,
"inventory": 1,
"job_args": "[]",
"job_cwd": "",
"job_explanation": "",
"job_type": "run",
"launch_type": "manual",
"limit": "",
"modified": "2020-12-29 13:28:21.763189",
"module_args": "",
"module_name": "ping",
"name": "ping",
"result_traceback": "",
"started": "2020-12-29T13:28:21.829663Z",
"status": "failed",
"type": "ad_hoc_command",
"url": "/api/v2/ad_hoc_commands/1/"
}
}
}

Human Readable Output#

Ad hoc command - 1 status - failed#

nameidtypeurlcreatedmodifiedlaunch_typestatusfailedstartedfinishedelapsedjob_argsjob_cwdexecution_nodejob_typeinventorycredentialmodule_namebecome_enabled
ping1ad_hoc_command/api/v2/ad_hoc_commands/1/2020-12-29 13:28:21.5384002020-12-29 13:28:21.763189manualfailedtrue2020-12-29T13:28:21.829663Z2020-12-29T13:28:24.029843Z2.2[]awxrun11pingfalse

ansible-tower-job-events-list-by-id#


Retrieves the list of job events of specific job.

Base Command#

ansible-tower-job-events-list-by-id

Input#

Argument NameDescriptionRequired
job_idThe ID of the job event.Required
pageThe page number to retrieve. Default is 1. Default is 1.Optional
page_sizePage size. Default is 50. Default is 50.Optional
searchThe search query string used to perform a case-insensitive search within all designated text fields of a model.Optional

Context Output#

PathTypeDescription
AnsibleAWX.JobEvents.idNumberDatabase ID for this job event.
AnsibleAWX.JobEvents.typeStringData type for this job event.
AnsibleAWX.JobEvents.urlStringURL for this job event.
AnsibleAWX.JobEvents.createdDateTimestamp indicating when this job event was created.
AnsibleAWX.JobEvents.modifiedDateTimestamp indicating when this job event was last modified.
AnsibleAWX.JobEvents.jobNumberJob ID.
AnsibleAWX.JobEvents.eventStringThe specific event. For example, runner_on_failed (Host Failed), runner_on_start (Host Started), etc.
AnsibleAWX.JobEvents.counterNumberJob event counter.
AnsibleAWX.JobEvents.event_displayStringEvent display. For example, Playbook Started.
AnsibleAWX.JobEvents.event_levelNumberThe event level.
AnsibleAWX.JobEvents.failedBooleanWhether the job failed.
AnsibleAWX.JobEvents.changedBooleanWhether the job changed.
AnsibleAWX.JobEvents.uuidStringUUID of the job event.
AnsibleAWX.JobEvents.parent_uuidStringParent UUID.
AnsibleAWX.JobEvents.hostNumberHost ID associated with the event.
AnsibleAWX.JobEvents.host_nameStringHost name associated with the event.
AnsibleAWX.JobEvents.playbookStringPlaybook name of this job.
AnsibleAWX.JobEvents.taskStringTask name.
AnsibleAWX.JobEvents.stdoutStringStandard output of the job.
AnsibleAWX.JobEvents.start_lineNumberStarting line number of the execution.
AnsibleAWX.JobEvents.end_lineNumberEnding line number of the execution.
AnsibleAWX.JobEvents.event_dataStringJob's raw event data.

Command Example#

!ansible-tower-job-events-list-by-id job_id=69

Context Example#

{
"AnsibleAWX": {
"JobEvents": [
{
"changed": false,
"counter": 1,
"created": "2020-12-20 15:27:19.104059",
"end_line": 0,
"event": "playbook_on_start",
"event_display": "Playbook Started",
"event_level": 0,
"failed": false,
"host": null,
"host_name": "",
"id": 1,
"modified": "2020-12-20 15:27:19.137215",
"parent_uuid": "",
"playbook": "hello_world.yml",
"start_line": 0,
"stdout": "",
"task": "",
"type": "job_event",
"url": "/api/v2/job_events/1/",
"event_data": {},
"uuid": "331e9ca5-56e2-4c2e-b77c-40fef9b95502"
}
]
}
}

Human Readable Output#

Results#

typeidurlcreatedmodifiedeventcounterevent_displayevent_levelfailedchangeduuidparent_uuidhosthost_nameplaybooktaskstdoutstart_lineend_line
job_event1/api/v2/job_events/1/2020-12-20 15:27:19.1040592020-12-20 15:27:19.137215playbook_on_start1Playbook Started0falsefalse331e9ca5-56e2-4c2e-b77c-40fef9b95502hello_world.yml00