# Dynamically alter remote\_tmp

**URL:** <https://forum.ansible.com/t/dynamically-alter-remote-tmp/20920>\
**Category:** Ansible Project\
**Created:** [March 18, 2016, 3:10pm UTC](https://forum.ansible.com/t/dynamically-alter-remote-tmp/20920 "2016-03-18T15:10:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chris\_scott](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@chris\_scott](https://forum.ansible.com/u/chris_scott)\
**Post date:** [March 18, 2016, 3:10pm UTC](https://forum.ansible.com/t/dynamically-alter-remote-tmp/20920/1 "2016-03-18T15:10:03Z")

</div>

I have a simple problem. I’m pushing up a tarball with the unarchive module, and the dest setting is pointing to a large volume. However it unarchive module pushes the file to the remote\_tmp dir 1st. This is on /home be default, however /home isnt big enough to take the tarball on the system machine image. The copy module also has the same problem. Altering the remote\_tmp variable in the .cfg file is easy enough, however this then affects everything on the ansible system, and will break other things. Therefore I need to be able to set this variable on the fly in the role, or worst case the play. However all my attempts seem to get ignored.

I have tried the following on the cli

---

<div class="post-metadata">

**Author:** ![chris\_scott](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@chris\_scott](https://forum.ansible.com/u/chris_scott)\
**Post date:** [March 18, 2016, 3:12pm UTC](https://forum.ansible.com/t/dynamically-alter-remote-tmp/20920/2 "2016-03-18T15:12:12Z")

</div>

-e “ANSIBLE\_REMOTE\_TEMP=/cedar/”  
and

-e “remote\_tmp=/cedar/”

ive also done the following in the play and the role

environment:  
remote\_tmp=/cedar/.tmp  
ANSIBLE\_REMOTE\_TEMP=/cedar/.tmp

Both modules still write to ~/.ansible/tmp as their tmp dir though

---

<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:** [March 18, 2016, 3:58pm UTC](https://forum.ansible.com/t/dynamically-alter-remote-tmp/20920/3 "2016-03-18T15:58:11Z")

</div>

remote\_tmp is set in ansible.cfg and ANSIBLE\_REMOTE\_TEMP should be a env var BEFORE ansible runs not inside Ansible:

ANSIBLE\_REMOTE\_TEMP=/cedar/.tmp ansible-playbook play.yml …
