I'm running ansible 2.6.4
on python 2.7.5
. This is my directory structure:
inventory/all
group_vars/all.yml
group_vars/lab.yml
playbook.yml
...
This is my inventory/all
:
[lab]
localhost
all.yml
contains a bunch of defaults, lab.yml
has a few overrides. In particular, a repo URL is different. When I run the playbook with ansible-playbook -i /workspace/inventory/all -c local --diff -v /workspace/local.yml
, the vars in group_vars/lab.yml
are never loaded. Note that I'm running the command from somewhere other than /workspace
. If I add -e @group_vars/lab.yml
, the vars are loaded the playbook runs as it should.
I wouldn't normally care that much, and simply run commands with -e @group_vars/lab.yml
, except that I'm attempting to get these playbooks running in AWX, which presents the same vars-not-loading behavour.
edit
came back to this with fresh eyes. playbook had vars_files: [group_vars/all.yml]
in it. removed that and all was right with the world.