From c6e400fbeacdfc5f66a739ec2a2d61cdc9d00672 Mon Sep 17 00:00:00 2001 From: Christoph Dittmann Date: Wed, 2 Dec 2015 10:55:04 +0100 Subject: [PATCH] Fix issue #13370 all_blocks is referenced after the loop over included_files, so it needs to be initialized before this loop, not inside. --- lib/ansible/plugins/strategy/free.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/plugins/strategy/free.py b/lib/ansible/plugins/strategy/free.py index e83184891dc..c8e6053a183 100644 --- a/lib/ansible/plugins/strategy/free.py +++ b/lib/ansible/plugins/strategy/free.py @@ -145,6 +145,7 @@ class StrategyModule(StrategyBase): return False if len(included_files) > 0: + all_blocks = dict((host, []) for host in hosts_left) for included_file in included_files: # included hosts get the task list while those excluded get an equal-length # list of noop tasks, to make sure that they continue running in lock-step @@ -157,7 +158,6 @@ class StrategyModule(StrategyBase): continue display.debug("generating all_blocks data") - all_blocks = dict((host, []) for host in hosts_left) display.debug("done generating all_blocks data") for new_block in new_blocks: task_vars = self._variable_manager.get_vars(loader=self._loader, play=iterator._play, task=included_file._task)