This module gets the status of an asynchronous task.
This module is also supported for Windows targets.
Parameter | Choices/Defaults | Comments |
---|---|---|
jid
string
/ required
|
Job or task identifier
|
|
mode
string
|
|
If
status , obtain the status.If
cleanup , clean up the async job cache (by default in ~/.ansible_async/ ) for the specified job jid. |
See also
Detailed information on how to use asynchronous actions and polling.
---
- name: Asynchronous yum task
yum:
name: docker-io
state: present
async: 1000
poll: 0
register: yum_sleeper
- name: Wait for asynchronous job to end
async_status:
jid: '{{ yum_sleeper.ansible_job_id }}'
register: job_result
until: job_result.finished
retries: 30
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
ansible_job_id
string
|
success |
The asynchronous job id
Sample:
360874038559.4169
|
finished
integer
|
success |
Whether the asynchronous job has finished (
1 ) or not (0 )Sample:
1
|
started
integer
|
success |
Whether the asynchronous job has started (
1 ) or not (0 )Sample:
1
|
This module is guaranteed to have no backward incompatible interface changes going forward. [stableinterface]
This module is maintained by the Ansible Core Team. [core]
More information about Red Hat’s support of this module is available from this Red Hat Knowledge Base article.
Ansible Core Team
Michael DeHaan
Hint
If you notice any issues in this documentation you can edit this document to improve it.