Browse code

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

Carl authored on 2016/05/11 06:00:07
Showing 1 changed files
... ...
@@ -96,7 +96,7 @@ class PlaybookInclude(Base, Conditional, Taggable):
96 96
             # plays. If so, we can take a shortcut here and simply prepend them to
97 97
             # those attached to each block (if any)
98 98
             if forward_conditional:
99
-                for task_block in entry.tasks:
99
+                for task_block in entry.pre_tasks + entry.roles + entry.tasks + entry.post_tasks:
100 100
                     task_block.when = self.when[:] + task_block.when
101 101
 
102 102
         return pb