ansible windows raw module no response?

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?

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

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写道:

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?