Fix bugs related to task_includes and dep chain inheritance

* Fix the way task_include fields were created and copied
* Have blocks get_dep_chain() look at task_include's blocks for proper
  dep chain inheritance
* Fix the way task_include fields are copied to prevent a recursive
  degradation

Fixes #14460
This commit is contained in:
James Cammarata 2016-02-13 01:02:47 -05:00
parent 22aaff5af7
commit 06b072c1f7
2 changed files with 7 additions and 8 deletions

View file

@ -452,7 +452,7 @@ class StrategyBase:
block_list = load_list_of_blocks(
data,
play=included_file._task._block._play,
parent_block=included_file._task._block,
parent_block=None,
task_include=included_file._task,
role=included_file._task._role,
use_handlers=is_handler,
@ -478,11 +478,7 @@ class StrategyBase:
# set the vars for this task from those specified as params to the include
for b in block_list:
# first make a copy of the including task, so that each has a unique copy to modify
# FIXME: not sure if this is the best way to fix this, as we might be losing
# information in the copy. Previously we assigned the include params to
# the block variables directly, which caused other problems, so we may
# need to figure out a third option if this also presents problems.
b._task_include = b._task_include.copy(exclude_block=True)
b._task_include = b._task_include.copy()
# then we create a temporary set of vars to ensure the variable reference is unique
temp_vars = b._task_include.vars.copy()
temp_vars.update(included_file._args.copy())