mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-26 20:31:27 -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
|
@ -99,8 +99,10 @@ class TestPlayContext(unittest.TestCase):
|
|||
ansible_ssh_port = 4321,
|
||||
)
|
||||
|
||||
mock_templar = MagicMock()
|
||||
|
||||
play_context = PlayContext(play=mock_play, options=options)
|
||||
play_context = play_context.set_task_and_variable_override(task=mock_task, variables=all_vars)
|
||||
play_context = play_context.set_task_and_variable_override(task=mock_task, variables=all_vars, templar=mock_templar)
|
||||
self.assertEqual(play_context.connection, 'mock_inventory')
|
||||
self.assertEqual(play_context.remote_user, 'mocktask')
|
||||
self.assertEqual(play_context.port, 4321)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue