summaryrefslogtreecommitdiff
path: root/lib/ansible/playbook
diff options
context:
space:
mode:
authorMartin Krizek <martin.krizek@gmail.com>2020-04-21 09:36:35 +0200
committerGitHub <noreply@github.com>2020-04-21 09:36:35 +0200
commitcb389f6c31287487c24b590a20d9a1061abf81fe (patch)
tree99a587cf7bfb2660f823ac9eb2b147688e48b464 /lib/ansible/playbook
parent122743ae300eaec64f398ebd7ff9f98dbe60f033 (diff)
downloadansible-cb389f6c31287487c24b590a20d9a1061abf81fe.tar.gz
Prevent rewriting nested Block's data in filter_tagged_tasks (#68337)
This patch fixes the issue where nested Block copies were created from incorrect Block object. This resulted in nested Blocks data like ``name`` or ``_uuid`` to contain values from the Block the filter_tagged_tasks method was called on.
Diffstat (limited to 'lib/ansible/playbook')
-rw-r--r--lib/ansible/playbook/block.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/ansible/playbook/block.py b/lib/ansible/playbook/block.py
index 2bd7bd8a41..71fde71500 100644
--- a/lib/ansible/playbook/block.py
+++ b/lib/ansible/playbook/block.py
@@ -379,7 +379,8 @@ class Block(Base, Conditional, CollectionSearch, Taggable):
return tmp_list
def evaluate_block(block):
- new_block = self.copy(exclude_tasks=True)
+ new_block = block.copy(exclude_parent=True, exclude_tasks=True)
+ new_block._parent = block._parent
new_block.block = evaluate_and_append_task(block.block)
new_block.rescue = evaluate_and_append_task(block.rescue)
new_block.always = evaluate_and_append_task(block.always)