win_shell hangs

97 views
Skip to first unread message

Hmdi Bz

unread,
Feb 20, 2017, 8:40:09 AM2/20/17
to Ansible Project
hello,
I tried to execute a bash script ( the script is inside the remote windows server)
the bash script was executed but the win_shell  task hangs.
win_shell: chdir="C:\\someApp\\bin" ./start.bat

J Hawkesworth

unread,
Feb 28, 2017, 8:39:54 AM2/28/17
to Ansible Project
Not a lot of information to go on here, but it looks like you might need to change syntax, looking at the examples here:

try something like this in your playbook

win_shell: start.bat
args
:
  chdir: C:\someApp\bin

Hmdi Bz

unread,
Mar 2, 2017, 10:33:50 AM3/2/17
to Ansible Project
Hello,
thank you for the reply,

the issue is within the "someApp", even if I start the app manually a cmd windows pops up to start it and when I run the C:\someApp\bin\stop.bat the App stops however the opened cmd windows never closes and that leads the powershell to keep the session alive on until the closure of the cmd windows .

My solution to find the process and kill it after stopping the App.

J Hawkesworth

unread,
Mar 3, 2017, 12:29:45 PM3/3/17
to Ansible Project
Many apps with msi installers have a quiet mode for unattended installations. Might be worth checking to see if your app has a silent mode. Often there is a /qn option you can pass to the installer program.

Hope this helps,


Jon

Hmdi Bz

unread,
Mar 4, 2017, 2:04:01 AM3/4/17
to Ansible Project
The app is embededd inside an osgi container (karaf), there is no installer,the app is started by just executing the karaf start script.

Thx
Reply all
Reply to author
Forward
0 new messages