# Missing something with host directory/file paths

**URL:** <https://forum.ansible.com/t/missing-something-with-host-directory-file-paths/22440>\
**Category:** Ansible Project\
**Created:** [August 31, 2016, 9:26pm UTC](https://forum.ansible.com/t/missing-something-with-host-directory-file-paths/22440 "2016-08-31T21:26:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jon\_Langemak](https://avatars.discourse-cdn.com/v4/letter/j/ac91a4/32.png) [@Jon\_Langemak](https://forum.ansible.com/u/Jon_Langemak)\
**Post date:** [August 31, 2016, 9:26pm UTC](https://forum.ansible.com/t/missing-something-with-host-directory-file-paths/22440/1 "2016-08-31T21:26:10Z")

</div>

It’s been awhile since I played with Ansible and right now Im tearing my hair out on this copy problem. Im trying to copy a directory on a Linux host to a new location. In ad-hoc ansible, it looks like this…

ansible -m copy -a “src=/usr/share/folder1 dest=/config/folder2” servers

When I run this command, Ansible tells me it can’t find the directory…

10.10.10.107 | FAILED! =\> {  
“changed”: false,  
“failed”: true,  
“msg”: “Unable to find ‘/usr/share/folder1’ in expected paths.”  
}

Yet, when I go on the host, I can clearly see that the source directory exists. Im thinking this is something terribly obvious since I’ve now tried this on multiple hosts and get the same error each time. I know Ansible is working because I can run adhoc shell commands and touch files, see the pwd, etc.

Any ideas at all? What am I missing?

Thanks!

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [August 31, 2016, 10:19pm UTC](https://forum.ansible.com/t/missing-something-with-host-directory-file-paths/22440/2 "2016-08-31T22:19:30Z")

</div>

by default ansible looks in the local ‘controller’ for the `src=` parameter, you need to use `remote_src=yes` for it to look for it on the target machine.

Also note that `remote_src=yes` does not support recursive copying.

---

<div class="post-metadata">

**Author:** ![Jon\_Langemak](https://avatars.discourse-cdn.com/v4/letter/j/ac91a4/32.png) [@Jon\_Langemak](https://forum.ansible.com/u/Jon_Langemak)\
**Post date:** [August 31, 2016, 11:51pm UTC](https://forum.ansible.com/t/missing-something-with-host-directory-file-paths/22440/3 "2016-08-31T23:51:26Z")

</div>

Thank you! Is there a better means to recursively copy then? Or do I need to copy each file separately?

---

<div class="post-metadata">

**Author:** ![Jon\_Langemak](https://avatars.discourse-cdn.com/v4/letter/j/ac91a4/32.png) [@Jon\_Langemak](https://forum.ansible.com/u/Jon_Langemak)\
**Post date:** [September 1, 2016, 1:54am UTC](https://forum.ansible.com/t/missing-something-with-host-directory-file-paths/22440/4 "2016-09-01T01:54:07Z")

</div>

I’ll answer this for myself. Seems like just using the command module and doing the copy that way is the best approach.

Thanks for putting me on the right track!
