I'm trying to group all host_vars files by their parent and I have the following folder structure:
- mail.yml
- hosts.yml
- group_vars/
- pool1.yml
- pool2.yml
- host_vars/
- ns1.me.yml
.....
and hosts.yml:
all:
children:
pool1:
hosts:
ns1.me:
ansible_host: 10.10.0.1
ns2.me:
ansible_host: 10.10.0.2
pool2:
hosts:
ns3.me:
ansible_host: 10.10.0.14
In this setup, it works fine but if I try to add a nested folder between host_vars and ns1.me.yml ansible will not get variables
From ansible docs: "You can also create directories named after your groups or hosts. Ansible will read all the files in these directories in lexicographical order." - https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html but isn't working ...
desired folder structure:
- host_vars/
- pool1/
- ns1.me.yml
- ns2.me.yml
- pool2/
- ns3.me.yml
What I'm missing? :)