Ansible and where it looks for the host_vars directory

Hi All,

I’ve done a strace of ansible and ansible-playbook and noticed that “ansible” will look at the ‘host_vars’ directory relative to the inventory script path, and “ansible-playbook” will look at that plus the ‘host_vars’ directory relative to the path where the playbook lives.

Is there a way to specify a root directory where ansible and ansible-playbook will both look for the {host,group}_vars directories?

  • GS

Nope.

It’s relative to inventory because it’s a property of inventory.

(What you are proposing would add a third location)

Yeah, fair enough. I guess I’ll just move host_vars and group_vars into the inventory directory.

Thanks :slight_smile:
GS