# How to fetch a file from remote server without creating additional subfolders

**URL:** <https://forum.ansible.com/t/how-to-fetch-a-file-from-remote-server-without-creating-additional-subfolders/16463>\
**Category:** Ansible Project\
**Created:** [October 8, 2014, 1:58pm UTC](https://forum.ansible.com/t/how-to-fetch-a-file-from-remote-server-without-creating-additional-subfolders/16463 "2014-10-08T13:58:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sam\_S](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@Sam\_S](https://forum.ansible.com/u/Sam_S)\
**Post date:** [October 8, 2014, 1:58pm UTC](https://forum.ansible.com/t/how-to-fetch-a-file-from-remote-server-without-creating-additional-subfolders/16463/1 "2014-10-08T13:58:18Z")

</div>

This works except it creates additional subdirectories within the destination. I just want to copy into my current working directory where I’m running ansible from.

# ansible all -m fetch -a “src=/tmp/pci.{{ inventory\_hostname }}.txt dest=pci-{{ inventory\_hostname }}.txt”

---

<div class="post-metadata">

**Author:** ![James\_Martin1](https://avatars.discourse-cdn.com/v4/letter/j/0ea827/32.png) [@James\_Martin1](https://forum.ansible.com/u/James_Martin1)\
**Post date:** [October 8, 2014, 2:59pm UTC](https://forum.ansible.com/t/how-to-fetch-a-file-from-remote-server-without-creating-additional-subfolders/16463/2 "2014-10-08T14:59:12Z")

</div>

There is the “flat” option: [http://docs.ansible.com/fetch\_module.html](http://docs.ansible.com/fetch_module.html)

- James

---

<div class="post-metadata">

**Author:** ![Sam\_S](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@Sam\_S](https://forum.ansible.com/u/Sam_S)\
**Post date:** [October 8, 2014, 3:02pm UTC](https://forum.ansible.com/t/how-to-fetch-a-file-from-remote-server-without-creating-additional-subfolders/16463/3 "2014-10-08T15:02:37Z")

</div>

I meant to reply to my original thread and say flat didn’t change anything.

---

<div class="post-metadata">

**Author:** ![James\_Martin1](https://avatars.discourse-cdn.com/v4/letter/j/0ea827/32.png) [@James\_Martin1](https://forum.ansible.com/u/James_Martin1)\
**Post date:** [October 8, 2014, 3:48pm UTC](https://forum.ansible.com/t/how-to-fetch-a-file-from-remote-server-without-creating-additional-subfolders/16463/4 "2014-10-08T15:48:15Z")

</div>

Please file a bug report on [github.com](http://github.com) for this issue.
