ansible / ansible.builtin / v2.16.0 / module / async_status Obtain status of asynchronous task | "added in version" 0.5 of ansible.builtin" Authors: Ansible Core Team, Michael DeHaan This plugin has a corresponding action plugin.ansible.builtin.async_status (v2.16.0) — module
pip
Install with pip install ansible-core==2.16.0
This module gets the status of an asynchronous task.
This module is also supported for Windows targets.
--- - name: Asynchronous yum task ansible.builtin.yum: name: docker-io state: present async: 1000 poll: 0 register: yum_sleeper
- name: Wait for asynchronous job to end ansible.builtin.async_status: jid: '{{ yum_sleeper.ansible_job_id }}' register: job_result until: job_result.finished retries: 100 delay: 10
- name: Clean up async file ansible.builtin.async_status: jid: '{{ yum_sleeper.ansible_job_id }}' mode: cleanup
jid: description: - Job or task identifier required: true type: str mode: choices: - cleanup - status default: status description: - If V(status), obtain the status. - If V(cleanup), clean up the async job cache (by default in C(~/.ansible_async/)) for the specified job O(jid), without waiting for it to finish. type: str
ansible_job_id: description: The asynchronous job id returned: success sample: '360874038559.4169' type: str erased: description: Path to erased job file returned: when file is erased type: str finished: description: Whether the asynchronous job has finished (V(1)) or not (V(0)) returned: always sample: 1 type: int started: description: Whether the asynchronous job has started (V(1)) or not (V(0)) returned: always sample: 1 type: int stderr: description: Any errors returned by async_wrapper returned: always type: str stdout: description: Any output returned by async_wrapper returned: always type: str