Based on these docs http://docs.ansible.com/ansible/playbooks_best_practices.html#group-and-host-variables I would think this should work.
I have a yml file with
db:
host: 123.45.6.7
pass: secret
etc… I put one in selenium_hub and one in website see below I am getting back the wrong vars - ansible selenium_hub -m debug -a “var=hostvars[inventory_hostname]”
shua@acm1-mgmt-us-east-1 17:26:10 (master) ~/infrastructure/ansible/group_vars
$ tree
.
├── all
│ ├── common.yml
│ ├── sudo.yml
│ └── users.yml
├── dev
│ ├── sudo.yml
│ ├── users.yml
│ └── website
│ ├── vars.yml
│ └── vault.yml
├── prod
│ ├── selenium_hub
│ │ └── vars.yml
│ ├── selenium_node
│ │ └── vars.yml
│ ├── sudo.yml
│ ├── users.yml
│ └── website
│ ├── vars.yml
│ └── vault.yml
└── us-east-1.yml
7 directories, 14 files
however when I do
$ ansible selenium_hub -m debug -a “var=hostvars[inventory_hostname]”
I get variables that are defined under prod website - what am I doing wrong?