Ansible long running task status

9 views
Skip to first unread message

Neha Singh

unread,
Feb 14, 2023, 4:19:53 AMFeb 14
to Ansible Development
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
Reply all
Reply to author
Forward
0 new messages