I want to run a very long process on windows machine through ansible. I want to trigger this process in background.
But wirnrm does not allow me to do this. it got stuck till that process not completed. I could not use win_nssm module, because i don’t want to create service. and also i could not use win_scheduled_task because i want to know process ID instantly.
Can anyone suggest what else i use instead of winrm module, or any other solution with winrm module.
What you want to do is possible but in reality you really don’t want to do it. This is the entire point of services and/or scheduled tasks which have arguably better error control and process handling than a detached process that you have to do with WinRM. If you are still interested you can start an async task with poll 0 and a really long async timeout value or spawn the detached process manually with WMI and Win32_Process but as I said you probably don’t want to do this in the long run.