# best practice temporary files

**URL:** <https://forum.ansible.com/t/best-practice-temporary-files/37189>\
**Category:** Ansible Project\
**Created:** [October 7, 2022, 10:54am UTC](https://forum.ansible.com/t/best-practice-temporary-files/37189 "2022-10-07T10:54:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dulhaver](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/dulhaver/32/1061_2.png) [@dulhaver](https://forum.ansible.com/u/dulhaver)\
**Post date:** [October 7, 2022, 10:54am UTC](https://forum.ansible.com/t/best-practice-temporary-files/37189/1 "2022-10-07T10:54:47Z")

</div>

we have trouble at times to access a git repository with config files directly from an ansible host.

As workaround we **get\_url** the file to the ansible controler (delegate\_to: localhost) and then **copy** it to the remote target in a second TASK.

There has been some hassle with git tracking those temporary files and we want to gitignore them in the future. Is there any common procedure or best practice for such a scenario?  
The first idea we came up with was to add a .temp directory inside the ansible folder and gitignore it’s contents.

---

<div class="post-metadata">

**Author:** ![dnmvisser](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@dnmvisser](https://forum.ansible.com/u/dnmvisser)\
**Post date:** [October 7, 2022, 5:40pm UTC](https://forum.ansible.com/t/best-practice-temporary-files/37189/2 "2022-10-07T17:40:05Z")

</div>

I would suggest fixing the actual problem with accessing the git repo
