I want to run a .exe on windows command prompt from my centos control node. The command is as follows :
wrapper.exe -t wrapper.conf
Initially i tried to atleast run the .exe without any args using my following playbook :
---
- hosts: windows
tasks:
- name: Register as a service
raw: 'D:\builds\router\bin\wrapper.exe'
But i got the following error:
fatal: [192.168.199.94]: FAILED! => {“changed”: false, “failed”: true, “rc”: 1, “stderr”: “#< CLIXML\r\n<Objs Version="1.1.0.1" xmlns="[http://schemas.microsoft.com/powershell/2004/04\](http://schemas.microsoft.com/powershell/2004/04\)”><S S="Error">D:x0008_uilds : The term 'D:x0008_uilds’ is not recognized as the name of a cmdlet, x000D__x000A<S S="Error">function, script file, or operable program. Check the spelling of the name, or x000D__x000A<S S="Error">if a path was included, verify that the path is correct and try again.x000D__x000A<S S="Error">At line:1 char:1_x000D__x000A<S S="Error">+ D:x0008_uilds_x000D__x000A<S S="Error">+ ~~~~~~~~x000D__x000A<S S="Error"> + CategoryInfo : ObjectNotFound: (D:x0008_uilds:String) [], CommandNot x000D__x000A<S S="Error"> FoundException_x000D__x000A<S S="Error"> + FullyQualifiedErrorId : CommandNotFoundException_x000D__x000A<S S="Error"> x000D__x000A<S S="Error">outer_x0008_in\wrapper.exe : The module ‘outer_x0008_in’ could not be loaded. For more x000D__x000A<S S="Error">information, run ‘Import-Module outer_x0008_in’.x000D__x000A<S S="Error">At line:2 char:1_x000D__x000A_<S S="Error">+ outer_x0008_in\wrapper.exe_x000D__x000A_<S S="Error">+ ~~~~~~~~~~~~~~~~~~~~x000D__x000A<S S="Error"> + CategoryInfo : ObjectNotFound: (outer_x0008_in\wrapper.exe:String) x000D__x000A<S S="Error"> , CommandNotFoundException_x000D__x000A_<S S="Error"> + FullyQualifiedErrorId : CouldNotAutoLoadModule_x000D__x000A_<S S="Error"> x000D__x000A", “stdout”: “”, “stdout_lines”: }
It appears as though the backslashes are escaping the character that
follows (which doesn't quite make sense since your example uses a
single-quoted string). What version of ansible are you using?
You could try: raw: "D:\\builds\\router\\bin\\wrapper.exe"
Try the raw command without any quotes, as in raw: D:\builds\router\bin\wrapper.exe. The following worked for me, and installed vlc on a test win2k8 box: