You don't mention which ansible version you are using, but I think latest 
devel version and possible 2.4.1 has some improvements to argument handling 
for win command.

If you are using an older ansible version, I suggest trying win_shell.  
 Make sure groovy is on your PATH (or use the args: chdir option of 
win_command / win_shell so that the command itself can be found too).

There's a very useful page about how to form windows paths in yaml for 
ansible playbooks recently been added to the documentation 
here: 
https://docs.ansible.com/ansible/devel/windows_usage.html#path-formatting-for-windows

Hope this helps,

Jon

On Monday, November 6, 2017 at 10:30:02 AM UTC, anoop vc wrote:
>
> Please find my YAML below
>
>
> *******************************************************
> ---
> - hosts: all
>   vars:
>   tasks:
>   - name: Save the result of 'whoami' in 'whoami_out'
>     win_command: groovy c:\AnsibletestWorkspace\deploy_latest.groovy
>     register: whoami_out
>
>
> ************************************************************************************************
>
> It adds an additional 
> slash(c:\\AnsibleMaximoWorkspace\\deploy_latest.groovy) to the windows path 
> the tell cannot find the path specified. I tried with backslash then it's 
> not add the double slash but still trown the error path to the file not 
> found. 
>
> I tried all the different combinations for specfy the path but no luck. 
>
>
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/5629b53d-7064-4df0-9ea7-5a12f8e36220%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to