I moved my inventory files to their own directory and now the group_vars are not loading.
Ansible Docs state:
Tip: In Ansible 1.2 or later the group_vars/ and host_vars/ directories can exist in either the playbook directory OR the inventory directory. If both paths exist, variables in the playbook directory will override variables set in the inventory directory.
My current layout is as follows:
├── hosts
│ └── dev
│ └── qa
├── group_vars
│ ├── all
│ └── dev
│ └── qa
├── roles
├── site.yml
What am I missing? If I move the inventory files back to the main directory with site.yml Ansible correctly pickups the group_vars.
[qa:children] notation in your inventory files,
If so make sure you’ve copied that into the correct files when you split out to use separate inventory files.
I ended up reverting back to my old file structure to continue working on other projects. I just now tried again by moving the inventories to their own directory and to my surprise they are now pulling in the group vars. Not sure what I did before, but it is working now.