mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-26 12:21:26 -07:00
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
This commit is contained in:
parent
9cc35b094f
commit
495a809f46
2 changed files with 3 additions and 2 deletions
|
@ -294,6 +294,7 @@ def load_list_of_tasks(ds, play, block=None, role=None, task_include=None, use_h
|
|||
# 2. one of the appropriate config options was set
|
||||
if 'import_role' in task_ds:
|
||||
is_static = True
|
||||
|
||||
if ir.static is not None:
|
||||
display.deprecated("The use of 'static' for 'include_role' has been deprecated. "
|
||||
"Use 'import_role' for static inclusion, or 'include_role' for dynamic inclusion")
|
||||
|
@ -315,6 +316,7 @@ def load_list_of_tasks(ds, play, block=None, role=None, task_include=None, use_h
|
|||
(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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue