mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-26 14:41:23 -07:00
Fix bug in implicit block squashing where block is not reassigned
Fixes #12333
This commit is contained in:
parent
7deb8bbd1c
commit
1cb4e0be1c
1 changed files with 3 additions and 1 deletions
|
@ -50,10 +50,12 @@ def load_list_of_blocks(ds, play, parent_block=None, role=None, task_include=Non
|
||||||
variable_manager=variable_manager,
|
variable_manager=variable_manager,
|
||||||
loader=loader
|
loader=loader
|
||||||
)
|
)
|
||||||
# Implicit blocks are created by bare tasks listed in a play withou
|
# Implicit blocks are created by bare tasks listed in a play without
|
||||||
# an explicit block statement. If we have two implicit blocks in a row,
|
# an explicit block statement. If we have two implicit blocks in a row,
|
||||||
# squash them down to a single block to save processing time later.
|
# squash them down to a single block to save processing time later.
|
||||||
if b._implicit and len(block_list) > 0 and block_list[-1]._implicit:
|
if b._implicit and len(block_list) > 0 and block_list[-1]._implicit:
|
||||||
|
for t in b.block:
|
||||||
|
t._block = block_list[-1]
|
||||||
block_list[-1].block.extend(b.block)
|
block_list[-1].block.extend(b.block)
|
||||||
else:
|
else:
|
||||||
block_list.append(b)
|
block_list.append(b)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue