mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 03:11:24 -07:00
Use the task loop to calculate multiple delegated hosts
Due to the way we're now calculating delegate_to, if that value is based on a loop variable ('item') we need to calculate all of the possible delegated_to variables for that loop. Fixes #12499
This commit is contained in:
parent
a1428d6bed
commit
31d5f88a1d
6 changed files with 91 additions and 39 deletions
|
@ -261,6 +261,11 @@ class TaskExecutor:
|
|||
|
||||
templar = Templar(loader=self._loader, shared_loader_obj=self._shared_loader_obj, variables=variables)
|
||||
|
||||
# apply the given task's information to the connection info,
|
||||
# which may override some fields already set by the play or
|
||||
# the options specified on the command line
|
||||
self._play_context = self._play_context.set_task_and_variable_override(task=self._task, variables=variables, templar=templar)
|
||||
|
||||
# fields set from the play/task may be based on variables, so we have to
|
||||
# do the same kind of post validation step on it here before we use it.
|
||||
# We also add "magic" variables back into the variables dict to make sure
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue