From efff75389d156c8b05b393dc384d4de6973b7cd2 Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Mon, 7 May 2018 10:01:35 -0500 Subject: [PATCH] Use updated task, instead of original, non-merged included_file._task (#39762) * Used updated task, instead of original, non-merged included_file._task. Fixes #39637 * Add changelog entry --- changelogs/fragments/includes.yaml | 1 + lib/ansible/plugins/strategy/linear.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/changelogs/fragments/includes.yaml b/changelogs/fragments/includes.yaml index 62eaf0f2062..a1e9aed2bd2 100644 --- a/changelogs/fragments/includes.yaml +++ b/changelogs/fragments/includes.yaml @@ -14,3 +14,4 @@ bugfixes: - dynamic includes - Allow inheriting attributes from static parents (https://github.com/ansible/ansible/pull/38827) - include_role/import_role - improved performance and recursion depth (https://github.com/ansible/ansible/pull/36470) - include_role/import_role - Fix parameter templating (https://github.com/ansible/ansible/pull/36372) +- dynamic includes - Use the copied and merged task for calculating task vars (https://github.com/ansible/ansible/pull/39762) diff --git a/lib/ansible/plugins/strategy/linear.py b/lib/ansible/plugins/strategy/linear.py index ff51b7d35cd..4de191a5ad8 100644 --- a/lib/ansible/plugins/strategy/linear.py +++ b/lib/ansible/plugins/strategy/linear.py @@ -363,7 +363,7 @@ class StrategyModule(StrategyBase): for new_block in new_blocks: task_vars = self._variable_manager.get_vars( play=iterator._play, - task=included_file._task, + task=new_block._parent ) display.debug("filtering new block on tags") final_block = new_block.filter_tagged_tasks(play_context, task_vars)