Fix bug where getting role vars does not follow the dep chain

This bug was introduced in 3ced6d3, where getting vars from a role
did not follow the dep chain. This was originally hidden by the fact
that we got vars twice (from the block and from the roles directly).

Fixes #16729

(cherry picked from commit d8a3feb976)
This commit is contained in:
James Cammarata 2016-07-19 16:59:11 -04:00
parent 35da6ba9d1
commit ed959d72f1

View file

@ -334,7 +334,7 @@ class VariableManager:
# vars (which will look at parent blocks/task includes) # vars (which will look at parent blocks/task includes)
if task: if task:
if task._role: if task._role:
all_vars = combine_vars(all_vars, task._role.get_vars(include_params=False)) all_vars = combine_vars(all_vars, task._role.get_vars(task._block._dep_chain, include_params=False))
all_vars = combine_vars(all_vars, task.get_vars()) all_vars = combine_vars(all_vars, task.get_vars())
# next, we merge in the vars cache (include vars) and nonpersistent # next, we merge in the vars cache (include vars) and nonpersistent