Playbook organization with var files

I have the same issues trying to manage a ton of playbooks that all use the same resources (which is how I stumbled upon this). However, after reading the comments, I think I better understand where Ansible is coming from.

(people who know I’m sure will correct me if I’m wrong)

It seems as though Ansible considers each playbook tied to an inventory and group_vars are also explicitly tied to inventory. Therefore, it would reason that if you want to logically separate your playbooks into subdirectories, the separation should be along inventory boundaries such that the group_vars/ mostly do not need to be shared between playbook subdirs. Furthermore, if you do have resources that are shared (./group_vars/all, ./library/, ./filter_plugins/, &c), then you can accomplish this with symlinks.

That being said, it would be nice to have an option for ansible-playbook that set a reference directory.

e.g.

$ ansible-playbook -i thesehosts playbooks/thesehosts/this_playbook.yml --shared_dir=.

or

$ ANISBLE_PATH=. ansible-playbook -i thesehosts playbooks/thesehosts/this_playbook.yml

which would avoid the need for symlinks.

Of course … could all of this be avoided if we put ALL shared resources in /etc/ansible/ ? roles, group_vars, filter_plugins, &c?

you can already set plugins paths in ansible.cfg, as for
group/host_vars they are also relative to inventory, which I guess you
share across plays, so it all can already be organized 'globally'