mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
looped includes need unique references to prevent information bleeding
Fixes #12155
This commit is contained in:
parent
c17c5cac0b
commit
974b69d236
1 changed files with 7 additions and 0 deletions
|
@ -409,6 +409,13 @@ class StrategyBase:
|
||||||
|
|
||||||
# set the vars for this task from those specified as params to the include
|
# set the vars for this task from those specified as params to the include
|
||||||
for b in block_list:
|
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)
|
||||||
|
# then we create a temporary set of vars to ensure the variable reference is unique
|
||||||
temp_vars = b._task_include.vars.copy()
|
temp_vars = b._task_include.vars.copy()
|
||||||
temp_vars.update(included_file._args.copy())
|
temp_vars.update(included_file._args.copy())
|
||||||
b._task_include.vars = temp_vars
|
b._task_include.vars = temp_vars
|
||||||
|
|
Loading…
Reference in a new issue