Looking further into this I find conflicting information (maybe I 
understand it all wrong)

In https://github.com/ansible/ansible/issues/33177#issuecomment-356976272 
("when including playbook, group_vars of original playbook are ignored") 
@sivel says : 

We have discussed this in the Core Team Meeting on Jan 11, 2018.

After looking at the code previous to 2.4, and discussing what our 
expectations are, we have decided that the previous behavior was a bug, and 
we will not be adding functionality to mimic the pre 2.4 behavior.

but in https://github.com/ansible/ansible/issues/29008#issuecomment-330558987 
("import_playbook from child directory break var scope") @bcoca says :

The fix we are planning does 2 things:

   - keep a 'stack' of playbook paths, starting with the initial playbook 
   and ending with the 'current' one
   - group/host_vars processing should got through each path in order

So 'initial playbook' and the 'current playbook' adjacent group/host_vars 
will all be read (as well as any intermediate ones). This is still a change 
from previous behaviour but we believe this is the 'most' correct way of 
dealing with the variables.

in https://github.com/ansible/ansible/issues/32936#issuecomment-352700117 
("Host variables adjacent to master playbook are unavailable to included 
tasks") @lufik also mentions

The PLAYBOOK_VARS_ROOT config doesn't change anything (it's only task 
related not playbook related). Shortly >=2.4.0 breaks the backward 
compatibility for including playbooks (maybe the caption of this issue 
should be changed also).

the code does seem to be in agreement 
(https://github.com/ansible/ansible/blob/stable-2.4/lib/ansible/vars/manager.py#L246)
 
though I am not familiar with the code base but I fail to see the 
differences between all 3 issues ... they all seem to have a structure 
similar to what I used in my experimentation.




-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/51d8fa94-ca65-4161-91c0-9396eada83bf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to