# Copy module error in windows

**URL:** <https://forum.ansible.com/t/copy-module-error-in-windows/33826>\
**Category:** Ansible Project\
**Tags:** azure, windows, awx\
**Created:** [September 16, 2020, 12:46pm UTC](https://forum.ansible.com/t/copy-module-error-in-windows/33826 "2020-09-16T12:46:41Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rubod\_singh](https://avatars.discourse-cdn.com/v4/letter/r/7ba0ec/32.png) [@rubod\_singh](https://forum.ansible.com/u/rubod_singh)\
**Post date:** [September 16, 2020, 12:46pm UTC](https://forum.ansible.com/t/copy-module-error-in-windows/33826/1 "2020-09-16T12:46:41Z")

</div>

HI Team,

please help me in this as i'm very new to this , i'm getting this  
error while testing the simple windows file copy module through awx.

Ansible VM is on Azure  
Target Windows machine is also on Azure - No network restrictions as  
this is a POC project

playbook :

---

<div class="post-metadata">

**Author:** ![Rahul\_Puli](https://avatars.discourse-cdn.com/v4/letter/r/82dd89/32.png) [@Rahul\_Puli](https://forum.ansible.com/u/Rahul_Puli)\
**Post date:** [September 16, 2020, 1:20pm UTC](https://forum.ansible.com/t/copy-module-error-in-windows/33826/2 "2020-09-16T13:20:42Z")

</div>

Hello Rubod,

Please try to run the below code and check.

---

<div class="post-metadata">

**Author:** ![rubod\_singh](https://avatars.discourse-cdn.com/v4/letter/r/7ba0ec/32.png) [@rubod\_singh](https://forum.ansible.com/u/rubod_singh)\
**Post date:** [September 16, 2020, 3:28pm UTC](https://forum.ansible.com/t/copy-module-error-in-windows/33826/3 "2020-09-16T15:28:36Z")

</div>

Thanks Rahul -

got this error now

{  
&nbsp;&nbsp;&nbsp;&nbsp;"src": "C:\\abc.txt",  
&nbsp;&nbsp;&nbsp;&nbsp;"dest": "C:\\ansible\\abc.txt",  
&nbsp;&nbsp;&nbsp;&nbsp;"msg": "Could not find or access 'C:\\abc.txt'\nSearched  
in:\n\t/tmp/awx\_81\_g9rtokz0/project/projects/AWX\_POC/files/C:\\abc.txt\n\t/tmp/awx\_81\_g9rtokz0/project/projects/AWX\_POC/C:\\abc.txt\n\t/tmp/awx\_81\_g9rtokz0/project/projects/AWX\_POC/files/C:\\abc.txt\n\t/tmp/awx\_81\_g9rtokz0/project/projects/AWX\_POC/C:\\abc.txt  
on the Ansible Controller.\nIf you are using a module and expect the  
file to exist on the remote, see the remote\_src option",  
&nbsp;&nbsp;&nbsp;&nbsp;"exception": "Traceback (most recent call last):\n File  
\"/usr/lib/python3.6/site-packages/ansible/plugins/action/win\_copy.py\",  
line 402, in run\n source = self.\_find\_needle('files', source)\n  
File \"/usr/lib/python3.6/site-packages/ansible/plugins/action/\_\_init\_\_.py\",  
line 1192, in \_find\_needle\n return  
self.\_loader.path\_dwim\_relative\_stack(path\_stack, dirname, needle)\n  
File \"/usr/lib/python3.6/site-packages/ansible/parsing/dataloader.py\",  
line 327, in path\_dwim\_relative\_stack\n raise  
AnsibleFileNotFound(file\_name=source, paths=[to\_native(p) for p in  
search])\nansible.errors.AnsibleFileNotFound: Could not find or access  
'C:\\abc.txt'\nSearched  
in:\n\t/tmp/awx\_81\_g9rtokz0/project/projects/AWX\_POC/files/C:\\abc.txt\n\t/tmp/awx\_81\_g9rtokz0/project/projects/AWX\_POC/C:\\abc.txt\n\t/tmp/awx\_81\_g9rtokz0/project/projects/AWX\_POC/files/C:\\abc.txt\n\t/tmp/awx\_81\_g9rtokz0/project/projects/AWX\_POC/C:\\abc.txt  
on the Ansible Controller.\nIf you are using a module and expect the  
file to exist on the remote, see the remote\_src option\n",  
&nbsp;&nbsp;&nbsp;&nbsp;"\_ansible\_no\_log": false,  
&nbsp;&nbsp;&nbsp;&nbsp;"changed": false  
}

---

<div class="post-metadata">

**Author:** ![rubod\_singh](https://avatars.discourse-cdn.com/v4/letter/r/7ba0ec/32.png) [@rubod\_singh](https://forum.ansible.com/u/rubod_singh)\
**Post date:** [September 16, 2020, 3:29pm UTC](https://forum.ansible.com/t/copy-module-error-in-windows/33826/4 "2020-09-16T15:29:39Z")

</div>

actually

source file is also on windows server ( which is also the target server)

do we need to mention any remote\_host ?

---

<div class="post-metadata">

**Author:** ![Raju\_Das](https://avatars.discourse-cdn.com/v4/letter/r/7feea3/32.png) [@Raju\_Das](https://forum.ansible.com/u/Raju_Das)\
**Post date:** [September 16, 2020, 3:57pm UTC](https://forum.ansible.com/t/copy-module-error-in-windows/33826/5 "2020-09-16T15:57:09Z")

</div>

- name: Copy a single file where the source is on the remote host  
&nbsp;&nbsp;win\_copy:  
&nbsp;&nbsp;&nbsp;&nbsp;src: C:\Temp\foo.txt  
&nbsp;&nbsp;&nbsp;&nbsp;dest: C:\ansible\foo.txt  
&nbsp;&nbsp;&nbsp;&nbsp;\*remote\_src: yes \<-------------------------use this  
\*- name: Copy a folder recursively where the source is on the remote host  
&nbsp;&nbsp;win\_copy:  
&nbsp;&nbsp;&nbsp;&nbsp;src: C:\Temp  
&nbsp;&nbsp;&nbsp;&nbsp;dest: C:\ansible  
&nbsp;&nbsp;&nbsp;\* remote\_src: yes \<-----------------------use this\*

\*With regards\*

\*Raju Das\*

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [September 16, 2020, 4:01pm UTC](https://forum.ansible.com/t/copy-module-error-in-windows/33826/6 "2020-09-16T16:01:56Z")

</div>

In essence the remote\_src parameter is a Boolean:

[https://docs.ansible.com/ansible/latest/modules/win\_copy\_module.html#parameter-remote\_src](https://docs.ansible.com/ansible/latest/modules/win_copy_module.html#parameter-remote_src)

---

<div class="post-metadata">

**Author:** ![rubod\_singh](https://avatars.discourse-cdn.com/v4/letter/r/7ba0ec/32.png) [@rubod\_singh](https://forum.ansible.com/u/rubod_singh)\
**Post date:** [September 16, 2020, 4:50pm UTC](https://forum.ansible.com/t/copy-module-error-in-windows/33826/7 "2020-09-16T16:50:41Z")

</div>

thank you all

it worked finally.

i can start working on rest of the modules now.
