# New config file, please help test!

**URL:** <https://forum.ansible.com/t/new-config-file-please-help-test/11795>\
**Category:** Ansible Project\
**Created:** [August 13, 2012, 11:21pm UTC](https://forum.ansible.com/t/new-config-file-please-help-test/11795 "2012-08-13T23:21:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [August 13, 2012, 11:21pm UTC](https://forum.ansible.com/t/new-config-file-please-help-test/11795/1 "2012-08-13T23:21:59Z")

</div>

I've taught ansible to read from ~/.ansible.cfg or /etc/ansible/ansible.cfg, whichever it finds first. If it doesn't find either, old environment variable overrides should still work for  
now, but I may decide to smite these. This is very lightly tested, so please test (and patch) away as you like.

All code changes are in constants.py (which is due for a rename, but I'm not changing it just yet) and there is an example config file in the "examples/" directory if you would like to switch to this. These basically all set default values so the various command line switches are still present.

A really trivial use of the file would be if you really didn't like that "-u" now defaults to the current user, not root, you can just put in there:

[defaults]  
remote\_user=root

I will also now accept patches for configuring all sorts of other weird esoteric behaviors, depending on sanity and code impact of each. Various things should not be CLI options and I don't want to add more CLI options wherever possible, but it is ok if various things become config settings.

--Micahel

---

<div class="post-metadata">

**Author:** ![Jim\_Richardson](https://avatars.discourse-cdn.com/v4/letter/j/d07c76/32.png) [@Jim\_Richardson](https://forum.ansible.com/u/Jim_Richardson)\
**Post date:** [August 14, 2012, 4:58am UTC](https://forum.ansible.com/t/new-config-file-please-help-test/11795/2 "2012-08-14T04:58:56Z")

</div>

Would it be worthwhile to have it include ENV variable setting  
replacements also? I am thinking specifically of ANSIBLE\_REMOTE\_TMP  
personally, but others might be interested in different ones. I use  
that one a fair bit, and would prefer to keep the config for ansible  
stuff within it's filespace, rather than setting variables in bashrc  
or the like.

I'd be happy to work on that at least for the listed if it's something  
you can see accepting a PR for. If not, that's fine, setting in  
bashrc works 😛

---

<div class="post-metadata">

**Author:** ![Jonathan\_Palley](https://avatars.discourse-cdn.com/v4/letter/j/dc4da7/32.png) [@Jonathan\_Palley](https://forum.ansible.com/u/Jonathan_Palley)\
**Post date:** [August 14, 2012, 10:17am UTC](https://forum.ansible.com/t/new-config-file-please-help-test/11795/3 "2012-08-14T10:17:51Z")

</div>

Great feature. Is it possible to also make the current directory (or the directory of the playbook) be in the search path?

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [August 14, 2012, 11:51am UTC](https://forum.ansible.com/t/new-config-file-please-help-test/11795/4 "2012-08-14T11:51:28Z")

</div>

> Would it be worthwhile to have it include ENV variable setting  
> replacements also? I am thinking specifically of ANSIBLE\_REMOTE\_TMP  
> personally, but others might be interested in different ones. I use  
> that one a fair bit, and would prefer to keep the config for ansible  
> stuff within it's filespace, rather than setting variables in bashrc  
> or the like.

It was already done that way, in fact, though I haven't tested it.  
You can see the remote temp pattern in the config file and can edit it  
there.

(We do need to verify that this setting is ignored for the root  
account, becuase it may not have a homedir, just occurred to me that  
it might not ATM)

I'm seriously thinking of getting rid of the environment variable  
lookups as it's a bit of an unusual idiom (worked very very well at  
the time!) and currently the configuration  
file has higher priority. Since the RPM will lay down the  
configuration file, they would never be checked for many users.

---

<div class="post-metadata">

**Author:** ![Jim\_Richardson](https://avatars.discourse-cdn.com/v4/letter/j/d07c76/32.png) [@Jim\_Richardson](https://forum.ansible.com/u/Jim_Richardson)\
**Post date:** [August 14, 2012, 4:05pm UTC](https://forum.ansible.com/t/new-config-file-please-help-test/11795/5 "2012-08-14T16:05:45Z")

</div>

Cool, I hadn't looked at the code since I put in the  
ANSIBLE\_REMOTE\_TMP entry.  
Wasn't paying attention I think. sorry 🙂
