In Ansible 2.16.8 on a Mac (M1) running Python 3.12.4 (via homebrew) I am trying to setup a global group_vars/all.yml that can be overwritten by inventory/x/group_vars/all.yml if needed. However, it seems that the global file is overwriting the inventory specific values.
Given the following file:
# group_vars/all.yml
level: global all
# inventory/x/group_vars/all.yml
level: inventory all
# inventory/x/group_vars/test.yml
level: inventory group
And running:
ansible all -i inventory/x -m debug -a "var=level" -o
I get:
test-host | SUCCESS => { "changed": false, "level": "inventory group" }
non-test-host | SUCCESS => { "changed": false, "level": "global all" }
But I am expecting to get:
test-host | SUCCESS => { "changed": false, "level": "inventory group" }
non-test-host | SUCCESS => { "changed": false, "level": "inventory all" }