Hello All–
I’m trying to get a couple of jars up and running in the background on some Windows machines. My expected result is at the end of the play I have both jars running with logs for both, and they’re listening on ports 4444 and 24240 respectively. Here’s my tasks:
`
- raw: Start-Process javaw -ArgumentList ‘-jar C:\Users\Administrator\mySweetJar.jar’
- raw: Start-Process javaw -ArgumentList ‘-Dwebdriver.chrome.driver=C:\Windows\System32\chromedriver.exe -jar C:\selenium.jar -browserSessionReuse -browserTimeout 300 -timeout 300000 -maxSession 1 -log C:\Users\Administrator\node.log’
`
What actually happens is that Ansible reports the commands running successfully:
`
TASK [Starting MySweetJar…] ****************************************************
task path: /Users/allen.fisher/projects/setup-windows-SUT/playbook.yml:61
<XX.XX.XX.XX> ESTABLISH WINRM CONNECTION FOR USER: administrator on PORT 5985 TO XX.XX.XX.XX
<XX.XX.XX.XX> EXEC Start-Process javaw -ArgumentList ‘-jar C:\Users\Administrator\MySweetJar.jar’
ok: [XX.XX.XX.XX] => {“changed”: false, “invocation”: {“module_args”: {“_raw_params”: “Start-Process javaw -ArgumentList ‘-jar C:\Users\Administrator\MySweetJar.jar’”}, “module_name”: “raw”}, “rc”: 0, “stderr”: “”, “stdout”: “”, “stdout_lines”: }
TASK [Starting Selenium…] ****************************************************
task path: /Users/allen.fisher/projects/setup-windows-SUT/playbook.yml:63
<XX.XX.XX.XX> ESTABLISH WINRM CONNECTION FOR USER: administrator on PORT 5985 TO XX.XX.XX.XX
<XX.XX.XX.XX> EXEC Start-Process javaw -ArgumentList ‘-Dwebdriver.chrome.driver=C:\Windows\System32\chromedriver.exe -jar C:\selenium.jar -browserSessionReuse -browserTimeout 300 -timeout 300000 -maxSession 1 -log C:\Users\Administrator\node.log’
ok: [XX.XX.XX.XX] => {“changed”: false, “invocation”: {“module_args”: {“_raw_params”: “Start-Process javaw -ArgumentList ‘-Dwebdriver.chrome.driver=C:\Windows\System32\chromedriver.exe -jar C:\selenium.jar -browserSessionReuse -browserTimeout 300 -timeout 300000 -maxSession 1 -log C:\Users\Administrator\node.log’”}, “module_name”: “raw”}, “rc”: 0, “stderr”: “”, “stdout”: “”, “stdout_lines”: }
`
But the ports are not open, and there are no logs so it’s almost like Ansible is killing the process before it even gets going.
The commands run as I would expect on the box directly. I’ve tried bundling them into a PowerShell script and using the script module to execute the commands, I’ve tried both java.exe and javaw.exe with no success. Does anyone have a way to accomplish what I’m after?
Thanks, Allen