# per host configuration option

**URL:** <https://forum.ansible.com/t/per-host-configuration-option/14550>\
**Category:** Ansible Project\
**Created:** [February 12, 2014, 11:19am UTC](https://forum.ansible.com/t/per-host-configuration-option/14550 "2014-02-12T11:19:49Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Makimoto\_Marakatti](https://avatars.discourse-cdn.com/v4/letter/m/e19adc/32.png) [@Makimoto\_Marakatti](https://forum.ansible.com/u/Makimoto_Marakatti)\
**Post date:** [February 12, 2014, 11:19am UTC](https://forum.ansible.com/t/per-host-configuration-option/14550/1 "2014-02-12T11:19:49Z")

</div>

Hi

I’ve got a machine that needs to have remote\_tmp set to “$HOME/.ansible/tmp”. But this gives me issues with the rest of the boxes. So the option in the config file says “remote\_tmp = /tmp”.

I’ve tried to set the option on the inventory file for this host only:

commando remote\_tmp=$HOME/.ansible/tmp

and also as a host\_variable in host\_file\_dir/host\_vars/hostname:

$ cat host\_vars/commando  
-rw-rw-r-- 1 ansible ansible 35 Feb 12 10:34 host\_vars/commando

---

<div class="post-metadata">

**Author:** ![Brian\_Coca1](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@Brian\_Coca1](https://forum.ansible.com/u/Brian_Coca1)\
**Post date:** [February 12, 2014, 12:39pm UTC](https://forum.ansible.com/t/per-host-configuration-option/14550/2 "2014-02-12T12:39:02Z")

</div>

this is not currently configurable by host, just the ansible.cfg setting and the environment variable ANSIBLE\_REMOTE\_TEMP.

---

<div class="post-metadata">

**Author:** ![Makimoto\_Marakatti](https://avatars.discourse-cdn.com/v4/letter/m/e19adc/32.png) [@Makimoto\_Marakatti](https://forum.ansible.com/u/Makimoto_Marakatti)\
**Post date:** [February 12, 2014, 12:53pm UTC](https://forum.ansible.com/t/per-host-configuration-option/14550/3 "2014-02-12T12:53:44Z")

</div>

Is there a way then to set this in a playbook at runtime?

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [February 12, 2014, 12:57pm UTC](https://forum.ansible.com/t/per-host-configuration-option/14550/4 "2014-02-12T12:57:54Z")

</div>

Not currently.

Patches to add it as an inventory variable would be accepted (just apply to any group you need), but I’m not sure it really belongs as a playbook keyword.

---

<div class="post-metadata">

**Author:** ![Makimoto\_Marakatti](https://avatars.discourse-cdn.com/v4/letter/m/e19adc/32.png) [@Makimoto\_Marakatti](https://forum.ansible.com/u/Makimoto_Marakatti)\
**Post date:** [February 12, 2014, 2:19pm UTC](https://forum.ansible.com/t/per-host-configuration-option/14550/5 "2014-02-12T14:19:40Z")

</div>

Ok. So what are my options here? I cannot be the only person with a situation like this.  
Diverging OS baseline installs is one of the reasons ansible is used after all?  
Is there not any workaround?

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [February 12, 2014, 2:23pm UTC](https://forum.ansible.com/t/per-host-configuration-option/14550/6 "2014-02-12T14:23:06Z")

</div>

There is not, which is not saying I’m unsympathetic.

Needing to specify remote temp is an infrequent thing, and not really a common OS divergence thing most people run into anymore. Most folks just pick a path that works, like $HOME/tmp.

I’m a bit curious why the $HOME related option didn’t work across the board? Does the user not have a homedir?

---

<div class="post-metadata">

**Author:** ![Makimoto\_Marakatti](https://avatars.discourse-cdn.com/v4/letter/m/e19adc/32.png) [@Makimoto\_Marakatti](https://forum.ansible.com/u/Makimoto_Marakatti)\
**Post date:** [February 12, 2014, 3:57pm UTC](https://forum.ansible.com/t/per-host-configuration-option/14550/7 "2014-02-12T15:57:20Z")

</div>

Well, if I set remote\_tmp to the default I get the same error message as above in ~50% of my servers. Setting it to /tmp gives me issues with this single server.  
Having close to 400 boxes, I’m prone to lean to the less damaging option. It somehow has to do with the fact that in many of those failing %50 boxes the home dir is a shared one through NFS. But it’s not granted either to get an error because the home dir is on nfs: it just has more probabilities of failing. (IE: haven’t figured out yet what the real issues is…)

Reading about this, is there not the possibility to have a conf file in the playbook dir? That would actually take precedence over the main one??

At this point any advice is good 🙂

---

<div class="post-metadata">

**Author:** ![Walid](https://avatars.discourse-cdn.com/v4/letter/w/ea5d25/32.png) [@Walid](https://forum.ansible.com/u/Walid)\
**Post date:** [February 12, 2014, 4:16pm UTC](https://forum.ansible.com/t/per-host-configuration-option/14550/8 "2014-02-12T16:16:07Z")

</div>

what are the /tmp and $HOME/tmp permissions? I am wondering if it is a permission issue, you can fix it using the raw module?!

---

<div class="post-metadata">

**Author:** ![Makimoto\_Marakatti](https://avatars.discourse-cdn.com/v4/letter/m/e19adc/32.png) [@Makimoto\_Marakatti](https://forum.ansible.com/u/Makimoto_Marakatti)\
**Post date:** [February 13, 2014, 8:34am UTC](https://forum.ansible.com/t/per-host-configuration-option/14550/9 "2014-02-13T08:34:51Z")

</div>

No difference there really. I even tried to chmod 777 ~/.ansible to see if it made a difference, but no luck.  
I will get to the root cause eventually… 🙂

---

<div class="post-metadata">

**Author:** ![Walid](https://avatars.discourse-cdn.com/v4/letter/w/ea5d25/32.png) [@Walid](https://forum.ansible.com/u/Walid)\
**Post date:** [February 13, 2014, 9:06am UTC](https://forum.ansible.com/t/per-host-configuration-option/14550/10 "2014-02-13T09:06:06Z")

</div>

is any of the /tmp and $HOME/tmp in a shared file system?

---

<div class="post-metadata">

**Author:** ![Makimoto\_Marakatti](https://avatars.discourse-cdn.com/v4/letter/m/e19adc/32.png) [@Makimoto\_Marakatti](https://forum.ansible.com/u/Makimoto_Marakatti)\
**Post date:** [February 13, 2014, 9:48am UTC](https://forum.ansible.com/t/per-host-configuration-option/14550/11 "2014-02-13T09:48:28Z")

</div>

yes, /home is on nfs on some systems, but even if that raises chances of issues with ansible, it’s not conclusive. Some of the hosts that indeed have the /home shared do not show any issues. So there’s something going on, but haven’t yet figured it out.

---

<div class="post-metadata">

**Author:** ![Walid](https://avatars.discourse-cdn.com/v4/letter/w/ea5d25/32.png) [@Walid](https://forum.ansible.com/u/Walid)\
**Post date:** [February 13, 2014, 9:53am UTC](https://forum.ansible.com/t/per-host-configuration-option/14550/12 "2014-02-13T09:53:49Z")

</div>

no but system root or what ever user you are running ansible as (su, sudo, user) could have different permissions on an NFS mount than system permissions. root could be squashed, ids could be not mapped correctly

---

<div class="post-metadata">

**Author:** ![Makimoto\_Marakatti](https://avatars.discourse-cdn.com/v4/letter/m/e19adc/32.png) [@Makimoto\_Marakatti](https://forum.ansible.com/u/Makimoto_Marakatti)\
**Post date:** [February 13, 2014, 10:42am UTC](https://forum.ansible.com/t/per-host-configuration-option/14550/13 "2014-02-13T10:42:39Z")

</div>

I’ve been looking at all that, but work gets in the way! 🙂  
Right now I’m going to ignore that error in the lone box and get some things done. When I’m finished with the whole reorganisation, the issue most probably will have gone away…  
anyway, thanks for the help! appreciated!

---

<div class="post-metadata">

**Author:** ![Makimoto\_Marakatti](https://avatars.discourse-cdn.com/v4/letter/m/e19adc/32.png) [@Makimoto\_Marakatti](https://forum.ansible.com/u/Makimoto_Marakatti)\
**Post date:** [March 13, 2014, 12:41pm UTC](https://forum.ansible.com/t/per-host-configuration-option/14550/14 "2014-03-13T12:41:36Z")

</div>

Hi

Just bumping this thread to let interested parties know I found the solution for this.  
I had in .ansible.cfg this line:

`  
ask\_sudo\_pass = True

`

Once that was removed all issues have disappeared.  
Don’t really see why, but the fact remains: no problems whatsoever.  
I’m guessing that somehow ansible’s behaviour changes in unexpected ways for me to see.  
I connect through a user and then sudo to root. The first stage is done through ssh certs. No passwds there.  
The second is a normal sudo.  
If I add -K to the command line works flawlessly. with the setting on the .cfg file I get all kinds of weird behaviour that you can read on this thread.

Anyway. Solved!

Thanks all for the time

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [March 13, 2014, 1:27pm UTC](https://forum.ansible.com/t/per-host-configuration-option/14550/15 "2014-03-13T13:27:45Z")

</div>

Sounds like you _might_ be an old version of Ansible where --ask-sudo-pass implies --sudo.

This really shouldn’t be the case anymore, so let us know what you are running.

Thanks!

---

<div class="post-metadata">

**Author:** ![Makimoto\_Marakatti](https://avatars.discourse-cdn.com/v4/letter/m/e19adc/32.png) [@Makimoto\_Marakatti](https://forum.ansible.com/u/Makimoto_Marakatti)\
**Post date:** [March 13, 2014, 1:48pm UTC](https://forum.ansible.com/t/per-host-configuration-option/14550/16 "2014-03-13T13:48:00Z")

</div>

Hi

Just updated to 1.5.2 from 1.5 few minutes ago.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [March 13, 2014, 1:49pm UTC](https://forum.ansible.com/t/per-host-configuration-option/14550/17 "2014-03-13T13:49:08Z")

</div>

Ok thanks if ask\_sudo\_pass in the config is causing --sudo, then this should definitely be a ticket. This implication we fixed in the CLI, but possibly not here.

Can you please file one on [github.com/ansible/ansible](http://github.com/ansible/ansible)?

Thanks!

---

<div class="post-metadata">

**Author:** ![Makimoto\_Marakatti](https://avatars.discourse-cdn.com/v4/letter/m/e19adc/32.png) [@Makimoto\_Marakatti](https://forum.ansible.com/u/Makimoto_Marakatti)\
**Post date:** [March 13, 2014, 2:24pm UTC](https://forum.ansible.com/t/per-host-configuration-option/14550/18 "2014-03-13T14:24:06Z")

</div>

Hi

issue #6467 raised.

---

<div class="post-metadata">

**Author:** ![Adam\_Lininger](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@Adam\_Lininger](https://forum.ansible.com/u/Adam_Lininger)\
**Post date:** [September 26, 2016, 4:29pm UTC](https://forum.ansible.com/t/per-host-configuration-option/14550/19 "2016-09-26T16:29:22Z")

</div>

I realize this is nearly 3 years old. However, I’ve run in to and finally diagnosed this issue (on my systems). The fuse code in the kernel makes a fuse filesystem only readable by the owning user…regardless of filesystem permissions. Not even root can override that.

It would be nice to be able to set remote\_tmp on a per-server basis (e.g. in the .cfg file).

Adam

---

<div class="post-metadata">

**Author:** ![Adam\_Lininger](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@Adam\_Lininger](https://forum.ansible.com/u/Adam_Lininger)\
**Post date:** [September 26, 2016, 7:09pm UTC](https://forum.ansible.com/t/per-host-configuration-option/14550/20 "2016-09-26T19:09:13Z")

</div>

Correction, as a per host variable in the inventory.
