mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 11:51:26 -07:00
Fix bugs related to task_includes and dep chain inheritance
* Fix the way task_include fields were created and copied * Have blocks get_dep_chain() look at task_include's blocks for proper dep chain inheritance * Fix the way task_include fields are copied to prevent a recursive degradation Fixes #14460
This commit is contained in:
parent
22aaff5af7
commit
06b072c1f7
2 changed files with 7 additions and 8 deletions
|
@ -153,6 +153,8 @@ class Block(Base, Become, Conditional, Taggable):
|
|||
if self._dep_chain is None:
|
||||
if self._parent_block:
|
||||
return self._parent_block.get_dep_chain()
|
||||
elif self._task_include:
|
||||
return self._task_include._block.get_dep_chain()
|
||||
else:
|
||||
return None
|
||||
else:
|
||||
|
@ -193,7 +195,8 @@ class Block(Base, Become, Conditional, Taggable):
|
|||
|
||||
new_me._task_include = None
|
||||
if self._task_include:
|
||||
new_me._task_include = self._task_include.copy()
|
||||
new_me._task_include = self._task_include.copy(exclude_block=True)
|
||||
new_me._task_include._block = self._task_include._block.copy(exclude_tasks=True)
|
||||
|
||||
return new_me
|
||||
|
||||
|
@ -374,7 +377,7 @@ class Block(Base, Become, Conditional, Taggable):
|
|||
return tmp_list
|
||||
|
||||
def evaluate_block(block):
|
||||
new_block = self.copy()
|
||||
new_block = self.copy(exclude_tasks=True)
|
||||
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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue