Why a progress over when ansible exec all tasks on windows?

20 views
Skip to first unread message

fcx...@gmail.com

unread,
Aug 1, 2016, 9:02:46 AM8/1/16
to Ansible Project
ansible 2.2.0
I use raw module to run a bat,and the bat exec a jar,the jar will always run because it's a monitoring program。But when ansible exec the taks over,the jar will also over,why?

J Hawkesworth

unread,
Aug 2, 2016, 1:08:28 AM8/2/16
to Ansible Project
I think that is just the way windows remoting works - when you log out it kills any processes you have created (similar to when you log out of a remote desktop window, rather than just disconnect).

It is definitely possible to get your java jar program to run if you set it up to run as a windows service.

There is probably more than one way to do this but one way is to install nssm - downloadable from here: https://nssm.cc/download and then use win_nssm module to set up your java program to run as a service.  Depending on what your java jar does it may need to run as a specific user.

I hope this helps.

Jon
Reply all
Reply to author
Forward
0 new messages