Browse code

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 020317b21bf54f49db56b95893be5e63a17ea4f8)

James Cammarata authored on 2017/06/21 23:28:36
Showing 2 changed files
... ...
@@ -296,6 +296,7 @@ def load_list_of_tasks(ds, play, block=None, role=None, task_include=None, use_h
296 296
                                 (use_handlers and C.DEFAULT_HANDLER_INCLUDES_STATIC) or \
297 297
                                 (not needs_templating and ir.all_parents_static() and not ir.loop)
298 298
                     display.debug('Determined that if include_role static is %s' % str(is_static))
299
+
299 300
                 if is_static:
300 301
                     # uses compiled list from object
301 302
                     t = task_list.extend(ir.get_block_list(variable_manager=variable_manager, loader=loader))
... ...
@@ -82,7 +82,6 @@ class IncludeRole(Task):
82 82
             dep_chain = []
83 83
         else:
84 84
             dep_chain = list(self._parent_role._parents)
85
-            dep_chain.extend(self._parent_role.get_all_dependencies())
86 85
             dep_chain.append(self._parent_role)
87 86
 
88 87
         blocks = actual_role.compile(play=myplay, dep_chain=dep_chain)
... ...
@@ -117,7 +116,7 @@ class IncludeRole(Task):
117 117
             if option in ir.args:
118 118
                 setattr(ir, option, ir.args.get(option))
119 119
 
120
-        return ir.load_data(data, variable_manager=variable_manager, loader=loader)
120
+        return ir
121 121
 
122 122
     def copy(self, exclude_parent=False, exclude_tasks=False):
123 123