ansible tries to parse files in <INVENTORY_DIR>/host_vars and <HOME_DIR>/host_vars even if they don't exist

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