# ansible tries to parse files in  \<INVENTORY\_DIR\>/host\_vars and \<HOME\_DIR\>/host\_vars even if they don't exist

**URL:** <https://forum.ansible.com/t/ansible-tries-to-parse-files-in-inventory-dir-host-vars-and-home-dir-host-vars-even-if-they-dont-exist/21552>\
**Category:** Ansible Project\
**Created:** [May 24, 2016, 6:02pm UTC](https://forum.ansible.com/t/ansible-tries-to-parse-files-in-inventory-dir-host-vars-and-home-dir-host-vars-even-if-they-dont-exist/21552 "2016-05-24T18:02:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![saraiva.joao](https://avatars.discourse-cdn.com/v4/letter/s/838e76/32.png) [@saraiva.joao](https://forum.ansible.com/u/saraiva.joao)\
**Post date:** [May 24, 2016, 6:02pm UTC](https://forum.ansible.com/t/ansible-tries-to-parse-files-in-inventory-dir-host-vars-and-home-dir-host-vars-even-if-they-dont-exist/21552/1 "2016-05-24T18:02:44Z")

</div>

Hi,

I’m using dynamic inventory and I pull the host list/groups from an external source (anonymous ldap query to freeipa). I have no host\_vars directories but every time I run ansible it tries to read the .yml, .yaml, .json for each host returned from the external source. I understand that every file in the host\_vars directories has to be parsed, it’s just the way ansible works, but in case the host\_vars directories don’t exist, shouldn’t ansible not look for any files there? Just stating all those non existent files makes the process very slow.

Ex:  
stat(“/opt/ansible/plugins/inventory”, {st\_mode=S\_IFDIR|0755, st\_size=4096, …}) = 0  
stat(“/opt/ansible/plugins/inventory”, {st\_mode=S\_IFDIR|0755, st\_size=4096, …}) = 0  
stat(“/opt/ansible/plugins/inventory/host\_vars/host1.testdomain”, 0x7ffeb541cf00) = -1 ENOENT (No such file or directory)  
stat(“/opt/ansible/plugins/inventory/host\_vars/host1.testdomain”, 0x7ffeb541cf00) = -1 ENOENT (No such file or directory)  
stat(“/opt/ansible/plugins/inventory/host\_vars/host1.testdomain.yml”, 0x7ffeb541cf00) = -1 ENOENT (No such file or directory)  
stat(“/opt/ansible/plugins/inventory/host\_vars/host1.testdomain.yaml”, 0x7ffeb541cf00) = -1 ENOENT (No such file or directory)  
stat(“/opt/ansible/plugins/inventory/host\_vars/host1.testdomain.json”, 0x7ffeb541cf00) = -1 ENOENT (No such file or directory)  
stat(“./”, {st\_mode=S\_IFDIR|0700, st\_size=1024, …}) = 0  
getcwd(“/home/ansible”, 1026) = 14  
stat(“/home/ansible/host\_vars/host1.testdomain”, 0x7ffeb541cf00) = -1 ENOENT (No such file or directory)  
stat(“/home/ansible/host\_vars/host1.testdomain”, 0x7ffeb541cf00) = -1 ENOENT (No such file or directory)  
stat(“/home/ansible/host\_vars/host1.testdomain.yml”, 0x7ffeb541cf00) = -1 ENOENT (No such file or directory)  
stat(“/home/ansible/host\_vars/host1.testdomain.yaml”, 0x7ffeb541cf00) = -1 ENOENT (No such file or directory)  
stat(“/home/ansible/host\_vars/host1.testdomain.json”, 0x7ffeb541cf00) = -1 ENOENT (No such file or directory)

Has anyone stumbled upon this?

Tks  
JS
