I am using Ansible
I have inventory file like this:
I run roles from playbooks like this:
- hosts: application
I define variables for testing environment in
I have roles
application group is not included in the
testing group I would expect running the
application role to fail because I have defined required variables only for testing group. In reality running
application.yaml works it is able to use variables defined in
group_vars/testing. Is that correct behaviour?
testing group seems have at least some effect, because if I remove it completely from inventory file, then running application roles fails because of undefined variables as expected.
group_vars supposed to work like this?
Is this maybe caused by the fact that I install roles on the same host?
(I don't have access to multiple machines right now so I cannot test with each role having their own machine.)
I have been reading through Ansible documentation such as Group vars doc but have not found answer to this.