ansible.windows.async_status module – Obtain status of asynchronous task
Note
This module is part of the ansible.windows collection (version 1.14.0).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install ansible.windows
.
To use it in a playbook, specify: ansible.windows.async_status
.
Synopsis
This module gets the status of an asynchronous task.
Parameters
Parameter |
Comments |
---|---|
Job or task identifier |
|
If If Choices:
|
See Also
See also
- ansible.builtin.async_status
The official documentation on the ansible.builtin.async_status module.
Examples
- name: Asynchronous yum task
ansible.windows.win_command: my.exe
async: 1000
poll: 0
register: long_cmd
- name: Wait for asynchronous job to end
ansible.builtin.async_status:
jid: '{{ long_cmd.ansible_job_id }}'
register: job_result
until: job_result.finished
retries: 100
delay: 10
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
The asynchronous job id Returned: success Sample: |
|
Path to erased job file Returned: when file is erased |
|
Whether the asynchronous job has finished ( Returned: always Sample: |
|
Whether the asynchronous job has started ( Returned: always Sample: |
|
Any errors returned by async_wrapper Returned: always |
|
Any output returned by async_wrapper Returned: always |