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

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?

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