# Retrieving a document to a unique name?

**URL:** <https://forum.ansible.com/t/retrieving-a-document-to-a-unique-name/32368>\
**Category:** Ansible Project\
**Created:** [March 2, 2020, 8:41pm UTC](https://forum.ansible.com/t/retrieving-a-document-to-a-unique-name/32368 "2020-03-02T20:41:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_Eggleston](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@Mike\_Eggleston](https://forum.ansible.com/u/Mike_Eggleston)\
**Post date:** [March 2, 2020, 8:41pm UTC](https://forum.ansible.com/t/retrieving-a-document-to-a-unique-name/32368/1 "2020-03-02T20:41:28Z")

</div>

I will write a program that looks for network devices on its local network and created a report of the findings. That’s easy. Using Ansible to push out the program and execute the program is easy. But how do I pull the report back to a unique name? For example the report is created as /tmp/report. I want to pull that file back to a file named /tmp/report-network.txt. What module do I use to pullback the file? The fetch module?

TIA

Mike

---

<div class="post-metadata">

**Author:** ![vbotka](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/vbotka/32/359_2.png) [@vbotka](https://forum.ansible.com/u/vbotka)\
**Post date:** [March 3, 2020, 1:07am UTC](https://forum.ansible.com/t/retrieving-a-document-to-a-unique-name/32368/2 "2020-03-03T01:07:13Z")

</div>

"fetch" module is a good choice to pull the report back to a unique name. The  
unique name will be automatically created by the module. Quoting:

&nbsp;&nbsp;"...default behavior of appending hostname/path/to/file to the  
&nbsp;&nbsp;destination ... retrieving files that are uniquely named per host."

This behaviour can be switched off by "flat: true".  
[https://docs.ansible.com/ansible/latest/modules/fetch\_module.html#parameters](https://docs.ansible.com/ansible/latest/modules/fetch_module.html#parameters)

HTH,

&nbsp;&nbsp;-vlado

---

<div class="post-metadata">

**Author:** ![Mike\_Eggleston](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@Mike\_Eggleston](https://forum.ansible.com/u/Mike_Eggleston)\
**Post date:** [March 6, 2020, 5:52pm UTC](https://forum.ansible.com/t/retrieving-a-document-to-a-unique-name/32368/3 "2020-03-06T17:52:11Z")

</div>

Thank you. That’s what I needed.

Mike
