# host\_vars with .yml

**URL:** <https://forum.ansible.com/t/host-vars-with-yml/20423>\
**Category:** Ansible Project\
**Created:** [February 2, 2016, 5:29pm UTC](https://forum.ansible.com/t/host-vars-with-yml/20423 "2016-02-02T17:29:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Warren\_Seine](https://avatars.discourse-cdn.com/v4/letter/w/ac8455/32.png) [@Warren\_Seine](https://forum.ansible.com/u/Warren_Seine)\
**Post date:** [February 2, 2016, 5:29pm UTC](https://forum.ansible.com/t/host-vars-with-yml/20423/1 "2016-02-02T17:29:50Z")

</div>

Hi,

I’m wondering why Ansible picks my variable file when it’s called host\_vars/local, but not host\_vars/local.yml.

Can I set a configuration flag to change this behavior?

Thanks,  
Warren.

---

<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:** [February 2, 2016, 9:21pm UTC](https://forum.ansible.com/t/host-vars-with-yml/20423/2 "2016-02-02T21:21:25Z")

</div>

no, this is the matching order precedence "", ".yml", ".yaml",  
".json", so local will be picked up if it exists in preference over  
local.yml

---

<div class="post-metadata">

**Author:** ![Warren\_Seine](https://avatars.discourse-cdn.com/v4/letter/w/ac8455/32.png) [@Warren\_Seine](https://forum.ansible.com/u/Warren_Seine)\
**Post date:** [February 3, 2016, 9:09am UTC](https://forum.ansible.com/t/host-vars-with-yml/20423/3 "2016-02-03T09:09:42Z")

</div>

I understand the order of precedence, but local.yml doesn’t get picked up even if there is no local.

---

<div class="post-metadata">

**Author:** ![Warren\_Seine](https://avatars.discourse-cdn.com/v4/letter/w/ac8455/32.png) [@Warren\_Seine](https://forum.ansible.com/u/Warren_Seine)\
**Post date:** [February 3, 2016, 9:55am UTC](https://forum.ansible.com/t/host-vars-with-yml/20423/4 "2016-02-03T09:55:20Z")

</div>

Ok, I’m wrong. The host\_vars directory was at the wrong place. It does pick the .yml file. Sorry for not checking properly.
