# hosts\_vars subdirectories

**URL:** <https://forum.ansible.com/t/hosts-vars-subdirectories/26184>\
**Category:** Ansible Project\
**Created:** [December 1, 2017, 10:21am UTC](https://forum.ansible.com/t/hosts-vars-subdirectories/26184 "2017-12-01T10:21:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vincent\_G](https://avatars.discourse-cdn.com/v4/letter/v/49beb7/32.png) [@Vincent\_G](https://forum.ansible.com/u/Vincent_G)\
**Post date:** [December 1, 2017, 10:21am UTC](https://forum.ansible.com/t/hosts-vars-subdirectories/26184/1 "2017-12-01T10:21:02Z")

</div>

Hi folks,

Is there a way to organize the host\_vars directory into subdirectories ?  
If not, where to ask for it ?

We have a large number of hosts (500+) and our usage actually suffer from this flat organization.

I would suggest to treat any files from /hosts\_vars/_/_ to be treated as they where sitting at the top level /host\_vars/  
So we could organize our hosts\_vars by location/role (I’m _not_ referring to the group\_vars… that we intensively use in conjunction !) :  
hosts\_vars/

- boston  
– (list of baremetal in boston)
- newyork  
– (list of baremetal in newyork)
- clients  
– (list of clients’s VM)  
(… and so on)

If someone knows a hack or point me to the right direction to adapt ansible to that, we will be glad to post a MR !

If this has already been discussed, please point me to the thread so I can convince you from my user story to allow that 🙂

Regards,

Vincent

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [December 1, 2017, 11:48pm UTC](https://forum.ansible.com/t/hosts-vars-subdirectories/26184/2 "2017-12-01T23:48:52Z")

</div>

in 2.4 this is controlled by a vars plugin (host\_group\_vars) you can  
override with your own version of it that 'ignores' the top directory  
and matches subdirs
