diff --git a/v2/ansible/plugins/strategies/linear.py b/v2/ansible/plugins/strategies/linear.py index 37a7ddf0fe..f8c0e3bee8 100644 --- a/v2/ansible/plugins/strategies/linear.py +++ b/v2/ansible/plugins/strategies/linear.py @@ -209,6 +209,7 @@ class StrategyModule(StrategyBase): results = self._wait_on_pending_results(iterator) host_results.extend(results) + # FIXME: this needs to be somewhere else class IncludedFile: def __init__(self, filename, args, task): self._filename = filename @@ -239,6 +240,8 @@ class StrategyModule(StrategyBase): include_file = self._loader.path_dwim(res._task.args.get('_raw_params')) include_variables = include_result.get('include_variables', dict()) + if 'item' in include_result: + include_variables['item'] = include_result['item'] inc_file = IncludedFile(include_file, include_variables, original_task) diff --git a/v2/samples/test_include.yml b/v2/samples/test_include.yml index b47b4fc8cb..c81e5ecd5a 100644 --- a/v2/samples/test_include.yml +++ b/v2/samples/test_include.yml @@ -20,6 +20,6 @@ - include: include.yml a=always handlers: - - name: foo - include: include.yml a="this is a handler" + #- name: foo + # include: include.yml a="this is a handler"