{
"src": "C:\\abc.txt",
"dest": "C:\\ansible\\abc.txt",
"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",
"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",
"_ansible_no_log": false,
"changed": false
}
- name: Copy a single file where the source is on the remote host
win_copy:
src: C:\Temp\foo.txt
dest: C:\ansible\foo.txt
*remote_src: yes <-------------------------use this
*- name: Copy a folder recursively where the source is on the remote host
win_copy:
src: C:\Temp
dest: C:\ansible
* remote_src: yes <-----------------------use this*