Process Monitoring in Ansible

20 views
Skip to first unread message

Jenisha T

unread,
May 21, 2020, 8:59:16 PM5/21/20
to Ansible Project
Is there a way in Ansible to find if process complete. I m running an os-copy process. How to check if the process completed. The hard way is to wait  for 2hrs and read logs to find the word in the log is there a sentence 
"OS copy success". Is there any elegant way to do it in ansible check if the process completes go to the next task instead of waiting for 2 hrs and then checking logs. 

Vladimir Botka

unread,
May 22, 2020, 1:40:03 AM5/22/20
to Jenisha T, ansible...@googlegroups.com
On Thu, 21 May 2020 17:59:15 -0700 (PDT)
Jenisha T <joy...@gmail.com> wrote:

> Is there a way in Ansible to find if process complete. I m running an
> os-copy process. How to check if the process completed. The hard way is to
> wait for 2hrs and read logs to find the word in the log is there a
> sentence "OS copy success".

There is only hard way "Asynchronous Actions and Polling"
https://docs.ansible.com/ansible/latest/user_guide/playbooks_async.html

> Is there any elegant way to do it in ansible check if
> the process completes go to the next task instead of waiting for 2 hrs and
> then checking logs.

AFAIK, there is no distributed interprocess communication. Probably because
of the large variety of supported platforms. Instead, the process might
trigger ansible-pull when ready
https://docs.ansible.com/ansible/latest/cli/ansible-pull.html

HTH,

-vlado
Reply all
Reply to author
Forward
0 new messages