I'm having an issue when running a Python script using the win_command module. The playbook execution hangs indefinitely when the Python script starts a Tomcat process which is supposed to keep running even once the script completes. If I were to manually kill the Tomcat process, the Ansible playbook completes.
---
- name: Restore product
  win_command: 'python restore-product.py'
  args:
    chdir: C:\temp  
I have tried the following within the Python script hoping that Ansible would not be able to track the launched process, but have had no luck:
subprocess.Popen('start /cmd /c service.bat startup', shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
sys.exit(0)
 
     
    