# Ansible long running task status

**URL:** <https://forum.ansible.com/t/ansible-long-running-task-status/37653>\
**Category:** Ansible Project\
**Created:** [February 13, 2023, 4:51am UTC](https://forum.ansible.com/t/ansible-long-running-task-status/37653 "2023-02-13T04:51:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![neha0021997](https://avatars.discourse-cdn.com/v4/letter/n/34f0e0/32.png) [@neha0021997](https://forum.ansible.com/u/neha0021997)\
**Post date:** [February 13, 2023, 4:51am UTC](https://forum.ansible.com/t/ansible-long-running-task-status/37653/1 "2023-02-13T04:51:29Z")

</div>

Hi Team,

Below is the two ansible task, one is for running patch installer and other task is to tracking the status of the completion of patch

**- name: Apply patch**  
**shell: nohup /media/updates/installer --no-screen --non-interactive --no-autoreboot \> /var/log/saas/patch\_install\_{{ box\_ip }}\_{{ patch\_file\_name }}.log**  
**async: 86400 #24 hours**  
**poll: 0**  
**register: patch\_installer**

**-name: Wait to complete patch installation**  
**async\_status: jid={{ patch\_installer.ansible\_job\_id }}**  
**register: console\_patch\_job\_results**  
**until: console\_patch\_job\_results.finished r**  
**etries: “{{ retry\_count }}”**  
**delay: 60**

For the second task I am getting the output in below manner in CMD:

**FAILED - RETRYING: Waiting to complete patch installation (239 retries left)**  
**FAILED - RETRYING: Waiting to complete patch installation (238 retries left)**

**…**

Now, here I don’t know the exact status of the patch task. I mean, whether it is in test mode, patch mode or doing something else. Even though, patch log file is creating, but I don’t want to check log everytime for any error or other debugging.  
I wanted some information like patch is running in which host, what is it mode, whether mode gets completed or not, its error message etc. in Command line only.

Could you please help me here.

Thanks & Regards  
Neha Singh

---

<div class="post-metadata">

**Author:** ![neha0021997](https://avatars.discourse-cdn.com/v4/letter/n/34f0e0/32.png) [@neha0021997](https://forum.ansible.com/u/neha0021997)\
**Post date:** [February 14, 2023, 9:23am UTC](https://forum.ansible.com/t/ansible-long-running-task-status/37653/2 "2023-02-14T09:23:18Z")

</div>

Hi Team,

Can someone please help with the below query.

Thanks & Regards  
Neha Singh

---

<div class="post-metadata">

**Author:** ![dnmvisser](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@dnmvisser](https://forum.ansible.com/u/dnmvisser)\
**Post date:** [February 14, 2023, 9:34am UTC](https://forum.ansible.com/t/ansible-long-running-task-status/37653/3 "2023-02-14T09:34:35Z")

</div>

I don't see how this would be possible.  
You execute a shell command and redirect all output to a log file.  
So, the only thing the async\_status task can know is the status of the process.  
This is what you use to decide how long that task is going to run  
(until it's finished).
