Don't include dependent roles in the dep chain for include_role

The dependency chain should not include roles below the parent, as it
can introduce very weird things like conditionals from child deps impacting
non-related roles.

Fixes #25136

(cherry picked from commit 495a809f46)
This commit is contained in:
James Cammarata 2017-06-21 15:28:36 +01:00 committed by Brian Coca
parent d189b668cb
commit 4d585c9035
2 changed files with 2 additions and 2 deletions

View file

@ -296,6 +296,7 @@ def load_list_of_tasks(ds, play, block=None, role=None, task_include=None, use_h
(use_handlers and C.DEFAULT_HANDLER_INCLUDES_STATIC) or \
(not needs_templating and ir.all_parents_static() and not ir.loop)
display.debug('Determined that if include_role static is %s' % str(is_static))
if is_static:
# uses compiled list from object
t = task_list.extend(ir.get_block_list(variable_manager=variable_manager, loader=loader))

View file

@ -82,7 +82,6 @@ class IncludeRole(Task):
dep_chain = []
else:
dep_chain = list(self._parent_role._parents)
dep_chain.extend(self._parent_role.get_all_dependencies())
dep_chain.append(self._parent_role)
blocks = actual_role.compile(play=myplay, dep_chain=dep_chain)
@ -117,7 +116,7 @@ class IncludeRole(Task):
if option in ir.args:
setattr(ir, option, ir.args.get(option))
return ir.load_data(data, variable_manager=variable_manager, loader=loader)
return ir
def copy(self, exclude_parent=False, exclude_tasks=False):