# win\_copy between two network shares

**URL:** <https://forum.ansible.com/t/win-copy-between-two-network-shares/27970>\
**Category:** Ansible Project\
**Created:** [July 6, 2018, 6:13am UTC](https://forum.ansible.com/t/win-copy-between-two-network-shares/27970 "2018-07-06T06:13:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ranjith\_ravi](https://avatars.discourse-cdn.com/v4/letter/r/df705f/32.png) [@ranjith\_ravi](https://forum.ansible.com/u/ranjith_ravi)\
**Post date:** [July 6, 2018, 6:13am UTC](https://forum.ansible.com/t/win-copy-between-two-network-shares/27970/1 "2018-07-06T06:13:55Z")

</div>

Hi,

I want to copy a file from network share to another network share in ansible.

But the problem is, i can able to pass credential for only one server using runas method.

Need suggestion on this issue. Below is my playbook

**[root@ansible wincopy]# cat roles/wincopy/tasks/main.yml**

- name: copy  
win\_copy:  
src=“\\192.168.1.168\f\  
test”

dest=“\\192.168.1.55\Soft\test”  
remote\_src=True  
become: yes  
become\_method: runas  
become\_flags: logon\_type=new\_credentials logon\_flags=netcredentials\_only  
vars:  
ansible\_become\_user: Username2  
ansible\_become\_pass: password2

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [July 6, 2018, 8:49am UTC](https://forum.ansible.com/t/win-copy-between-two-network-shares/27970/2 "2018-07-06T08:49:57Z")

</div>

I can only suggest workarounds

You could try creating a common user / password combination on both of the network shares, and use that user for the win\_copy task. Its not something I have tried, but it might work.

Otherwise you could split up the transfer and use smbclient to transfer files to your ansible controller and then win\_copy them from the controller to the destination share. If the files are large I’d consider using a web server and downloading using `win_get_url` as for large files this is much faster than win\_copy.

Hope this helps,

Jon
