win_copy failing

40 views
Skip to first unread message

Mark Matthews

unread,
Feb 10, 2016, 7:24:13 AM2/10/16
to Ansible Project

Hi

 

I am getting errors when trying to do a win_copy from a remote server to destinations servers.

 

The playbook is the following:

 

---

- name: Copy Website Live Template from server

  hosts: all

  tasks:

    - name: Copy Website Live Template from server

      win_copy:

        src: \\10.10.3.169\template\Live\

        dest: C:\Websites

 

The error is:
fatal: [10.10.3.170]: FAILED! => {"changed": false, "failed": true, "invocation": {"module_args": {"dest": "C:/Websites", "src": "/10.10.3.169/template/Live/"}, "module_name": "win_copy"}, "msg": "could not find src=/10.10.3.169/template/Live"}

 

I have tried all kinds of variations in the playbook…

 

        src: \10.10.3.169\template\Live

        dest: C:\Websites

 

        src: /10.10.3.169/template/Live/

        dest: C:/Websites

 

But keep getting errors.

 

Any idea what could be the cause of this?

 

 

Cheers

Mark Matthews

unread,
Feb 10, 2016, 10:34:41 AM2/10/16
to Ansible Project
Im trying to find out if it is possible to copy a folder (with sub folders) from one Windows server on the network to all Windows servers in the playbook?

J Hawkesworth

unread,
Feb 11, 2016, 6:15:19 AM2/11/16
to Ansible Project
I don't think win_copy can collect from a share like you are trying to do in the example above.

The assumption is that the source file you are copying is on the ansible controller.

One trick you could use is to run smbclient on the ansible controller to collect the files you want to deploy to your windows clients first, then you can win_copy them across.

You might be able to use script to collect files from a share but you are likely to need to pass credentials to the script running on your windows machines (windows makes a distinction about whether or not you are logged in as an interactive user - if you are not, such as when you are using remoting - then different permissions apply and you may not have access to the remote share).

Hope this helps,

Jon
Reply all
Reply to author
Forward
0 new messages