Running through Ansible is different from running locally because the tasks are being run under a WinRM logon. Windows treats network (WinRM) and interactive (local) logons differently and can have different behaviour and access permissions depending on the type of logon. My recommendations still stand;
- Split the batch file into smaller steps and run each one manually to see if it breaks - Add some logging to your batch file to log each step into a file to verify that is is actually running - Don't use a batch file and convert to a PowerShell script instead - Use become on the task to replicate how it would run on an interactive logon - Use native PowerShell with Invoke-Command to see if that works, Ansible uses a similar mechanism to execute tasks One thing I am curious about, the batch file is server.startup.bat which indicates this is trying to startup an executable. Unless you are using this to startup a scheduled task, service, or a process that is explicitly defined to breakaway from a job, you will find that once the initial WinRM process spawned from Ansible is completed, Windows will kill all of it's child processes. If this is the case, you really should be using a proper scheduler like Windows SCM or Scheduled tasks to run this and not try and spawn it directly from Ansible. Thanks Jordan -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/f048c37d-b7c8-4091-917b-d884fa957ad2%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.