From b63a3bd0c7d2f5ea6e82a567dc5e4b1a35adc506 Mon Sep 17 00:00:00 2001 From: Lorin Hochstein Date: Wed, 25 Jul 2012 13:26:07 -0400 Subject: [PATCH] Save module name and args when processing list of items. This is necessary because daisy-chained modules will overwrite these values. --- lib/ansible/runner/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/ansible/runner/__init__.py b/lib/ansible/runner/__init__.py index 39f4c68a289..1af7338cf77 100644 --- a/lib/ansible/runner/__init__.py +++ b/lib/ansible/runner/__init__.py @@ -492,7 +492,12 @@ class Runner(object): all_changed = False all_failed = False results = [] + # Save module name and args since daisy-chaining can overwrite them + module_name = self.module_name + module_args = self.module_args for x in items: + self.module_name = module_name + self.module_args = module_args inject['item'] = x result = self._executor_internal_inner(host, inject, port) results.append(result.result)