ansible windows raw module no response?

101 views
Skip to first unread message

fcx...@gmail.com

unread,
Jul 27, 2016, 12:28:56 PM7/27/16
to Ansible Project
I just want to run my bat by raw module,like 
- name: exec run.bat
 raw: C:\run.bat

The bat is about a program that get logs,so it will be always running,like Daemon. When I exec ansible-playbook,the task can't go on.How can I do?

J Hawkesworth

unread,
Jul 27, 2016, 7:34:49 PM7/27/16
to Ansible Project
If it is always running then may be you need to set up whatever the run.bat does as a windows service. 
You can install nssm.exe and use win_nssm module to install programs as services, and then use the win_service module to start and stop them.

You can use fetch module against windows machines if you just want to fetch log files when you run your playbook too.

There are lots of programs around that can collect log files and forward them to another machine for processing. Two that I have heard of, but not used are NXLOG and Elastic Filebeat.

Hope this helps,

Jon

fcx...@gmail.com

unread,
Aug 1, 2016, 9:02:45 AM8/1/16
to Ansible Project
 Thanks for your answer.I am not sure whether my program is well.But I think ansible should close the task if the task exec too long.

在 2016年7月28日星期四 UTC+8上午7:34:49,J Hawkesworth写道:

J Hawkesworth

unread,
Aug 2, 2016, 1:25:29 AM8/2/16
to Ansible Project
An optional configurable timeout would be nice, but I have some tasks that run for over 60 minutes so I would not want a short default.

Can you use Remote Desktop to check if your program is well perhaps?
Reply all
Reply to author
Forward
0 new messages