From fefd87c61a1cfa7ecc04394c56d45a2b8317d617 Mon Sep 17 00:00:00 2001 From: Carl Date: Tue, 10 May 2016 17:00:07 -0400 Subject: [PATCH] Fixes #15745 playbook include: Conditional scoping Fixes #15745 Applies conditional forwarding to all tasks/roles within the included playbook. The existing line only applies forwarded conditionals to the main Task block, and misses pre_, post_, and roles. Typo :: Made a selection mistake when I copied over the one line change --- lib/ansible/playbook/playbook_include.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/playbook/playbook_include.py b/lib/ansible/playbook/playbook_include.py index f481ba142c8..9cac3317c26 100644 --- a/lib/ansible/playbook/playbook_include.py +++ b/lib/ansible/playbook/playbook_include.py @@ -96,7 +96,7 @@ class PlaybookInclude(Base, Conditional, Taggable): # plays. If so, we can take a shortcut here and simply prepend them to # those attached to each block (if any) if forward_conditional: - for task_block in entry.tasks: + for task_block in entry.pre_tasks + entry.roles + entry.tasks + entry.post_tasks: task_block.when = self.when[:] + task_block.when return pb