Use get_dep_chain() instead of directly using a blocks _dep_chain

Child blocks (whether nested or via includes) don't get a copy of the
dependency chain, so the above method should be used to ensure the block
looks at its parents dep chain.

Fixes #15996
This commit is contained in:
James Cammarata 2016-05-26 15:46:59 -04:00
parent 4bf9cf6e41
commit a44743d142

View file

@ -232,7 +232,7 @@ class VariableManager:
# sure it sees its defaults above any other roles, as we previously
# (v1) made sure each task had a copy of its roles default vars
if task and task._role is not None:
all_vars = combine_vars(all_vars, task._role.get_default_vars(dep_chain=task._block._dep_chain))
all_vars = combine_vars(all_vars, task._role.get_default_vars(dep_chain=task._block.get_dep_chain()))
if host:
# next, if a host is specified, we load any vars from group_vars
@ -325,7 +325,7 @@ class VariableManager:
if task:
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_role_params(task._block._dep_chain))
all_vars = combine_vars(all_vars, task._role.get_role_params(task._block.get_dep_chain()))
all_vars = combine_vars(all_vars, task.get_vars())
if host: