On Mon, 13 Feb 2023 at 05:51, Neha Singh <[email protected]> wrote:
>
> 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.

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).

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAF8BbLau_W%3Di%2BSNtNHHtcrthHfez-yUupxQR16T4F5%2BakKjVew%40mail.gmail.com.

Reply via email to