Thanks for the quick reply. However I don't think it works.
Maybe I was not clear. Here is a small test case to demonstrate the issue:
proj1/inventory/hosts.yml
proj2/inventory/hosts.yml
proj3/playbook.yml
- hosts:
example1.com connection: local
tasks:
- debug:
var: bar
And run the playbook with
ansible-playbook -i ../proj1/inventory -i ../proj2/inventory playbook.yml
Apparently proj2's all.vars will override proj1's, so bar shows "from 2 all", which is not what I want.
I want proj3's inventory to have two groups, group1 and group2, where proj1's all.vars become group1's group vars, ditto for proj2, so all.vars don't get overridden. In the test case, I'd like bar to be "from 1 all"
Is this something possible to do?