Hi,
I’m currently having some issues while using Ansible with the Alternative Directory Layout as defined in the docs.
Let’s take the following inventory structure (which I like because it allows me to split neatly between different setups):
inventories
`-- my-setup
– group_vars
– group1
-- group2 -- hosts
– host_vars
`-- my-server.com
In group_vars I want to define some variables that override the default values set in the roles.
My problem is the following.
- This works as expected:
ansible-playbook -i inventories/my-setup ...
- This also works as expected:
ansible-playbook -i inventories/my-setup/hosts ...
- But this fails to apply whatever is defined in inventories/my-setup/group_vars:
ansible-playbook -i inventories ...
This behavior is - at least for me - counter intuitive because ansible still digs up the inventories/my-setup/hosts file but then doesn’t apply group_vars.
What I would expect is either apply the group_vars settings or complain that no inventory has been found.
The situation I want to avoid is that someone executes 3. and inadvertently deploys default values that break running setups.
Maybe I’m doing something wrong, but so far I fail to see what.
Any ideas ?
Thanks,
Vasco