I’ve been wondering on how am I going to move the contents of my group_vars and host_vars to a different location then I found https://github.com/ansible/ansible/issues/13051 which basically was rejected.
My use case is mainly to have a better organization of my configurations. Since I was able to specify a custom location for my inventory and roles_path as stated also in the above link, I also wanted to set a custom location for my group_vars and host_vars.
Currently, my Ansible directory tree looks like this:
Then, I want to have my group_vars and host_vars to be located at:
$ANSIBLE_DIR/vars/{groups,hosts}/
I find it messy (sorry) if my group_vars and host_vars are located inside the $ANSIBLE_DIR/environment/ directory. Thus, I want to move it to some other place.
Thank you and I hope you will consider this feature request.
Hi All,
As much as I hate to bring an old thread back to life, I have to as I’ve failed to find workarounds for this issue.
Based on my inventory file, I would like to keep the group_vars dir in multiple locations instead of the same single directory as it makes it harder to maintain.
So instead of
This would help in scalability when there are thousands of regions or even sub-regions
I have an inventory as below (This is a sample of a larger inventory of around 2000 hosts):