Note
This module is part of ansible-base and included in all Ansible installations. In most cases, you can use the short module name async_status even without specifying the collections: keyword. Despite that, we recommend you use the FQCN for easy linking to the module documentation and to avoid conflicting with other collections that may have the same module name.
New in version 0.5: of ansible.builtin
Note
This module has a corresponding action plugin.
| 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. |
Note
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: 100
delay: 10
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 |
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.10/collections/ansible/builtin/async_status_module.html