# DEFAULT\_REMOTE\_TMP not working

**URL:** <https://forum.ansible.com/t/default-remote-tmp-not-working/29952>\
**Category:** Ansible Project\
**Created:** [March 22, 2019, 9:30am UTC](https://forum.ansible.com/t/default-remote-tmp-not-working/29952 "2019-03-22T09:30:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![syed.qasim.sarfraz](https://avatars.discourse-cdn.com/v4/letter/s/a88e57/32.png) [@syed.qasim.sarfraz](https://forum.ansible.com/u/syed.qasim.sarfraz)\
**Post date:** [March 22, 2019, 9:30am UTC](https://forum.ansible.com/t/default-remote-tmp-not-working/29952/1 "2019-03-22T09:30:41Z")

</div>

Hi,

I want to fetch the custom controller remote directory and create it if required, I used the remote\_tmp in my ansible.cfg to set a custom value.

Previously I was using DEFAULT\_REMOTE\_TMP to get the custom value but I see a lot has changed after 2.4.0. Is there now a new way to do it?

I have a task using it as:

- name: Create remote\_tmp for it is used by another module  
file:  
path: “{{ lookup(‘config’, ‘DEFAULT\_REMOTE\_TMP’, on\_missing=‘skip’, wantlist=True) | first | default(‘~/.ansible/tmp’) }}”  
state: directory  
mode: 0700

Regards,  
Qasim Sarfraz

---

<div class="post-metadata">

**Author:** ![jborean](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jborean/32/1525_2.png) [@jborean](https://forum.ansible.com/u/jborean)\
**Post date:** [March 25, 2019, 8:10pm UTC](https://forum.ansible.com/t/default-remote-tmp-not-working/29952/2 "2019-03-25T20:10:51Z")

</div>

The remote tmp was changed around this version to become a shell plugin option and not a global option. You can see the ‘remote\_tmp’ option at [https://docs.ansible.com/ansible/latest/plugins/shell/sh.html](https://docs.ansible.com/ansible/latest/plugins/shell/sh.html), it’s defined using the same ini, env, and vars it’s just used by the shell plugin instead and made sense moving it there.

The DEFAULT\_LOCAL\_TMP is still global though but that’s not really what you should be doing.

As for looking up the value you are probably going at this the wrong way. If you want to rely on creating the tmp dir with your own permissions then it is better to set your own dir as a fact/var so you ensure that the directory is being used for that host, e.g.

`

- hosts: my host  
vars:  
ansible\_remote\_tmp: ~/.ansible-custom/tmp

tasks:

- name: Create remote\_tmp for it used by another module  
file:  
path: “{{ ansible\_remote\_tmp }}”  
state: directory  
mode: 0700

`

This way you are not stuck if the internal option name changes and you are now following the contracted interface which should be stable across versions.

Thanks

Jordan
