Hi,
so if I run on the command line, having used the inventory file to add 
user/password details under windows:vars
ansible mesh -u user1 -m win_shell -a "dir chdir=C:\Temp"

then I get

mesh | SUCCESS | rc=0 >>

    Directory: C:\Temp

Mode                LastWriteTime         Length Name         

But with a playbook

- name: Run a series of debug tasks to see the value of variables
  hosts: mesh
  user: user1
  tasks:
    - name: list all the files in temp on c drive
      win_command: dir
      args:
         chdir: c:\temp

I get
TASK [list all the files in temp on c drive] 
***********************************
fatal: [mesh]: FAILED! => {"changed": false, "cmd": "dir", "failed": true, 
"msg": "The system cannot find the file specified", "rc": 2}

The win_command module docs show do not show escaping of backslashes or 
quotes.

What am I doing wrong?

Regards,
John

-- 
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/bcb670fe-3fba-4b8c-888a-96b074238b7e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to