Make sure we're using the original host when processing include results

Also fixes a bug where we were passing an incorrect number of parameters to
_do_handler_run() when processing an include file in a handler task/block.

Fixes #13560
This commit is contained in:
James Cammarata 2015-12-16 19:12:05 -05:00
parent 857456ea5f
commit 15135f3c16
4 changed files with 29 additions and 8 deletions

View file

@ -576,6 +576,7 @@ class StrategyBase:
host_results,
self._tqm,
iterator=iterator,
inventory=self._inventory,
loader=self._loader,
variable_manager=self._variable_manager
)
@ -594,6 +595,7 @@ class StrategyBase:
for task in block.block:
result = self._do_handler_run(
handler=task,
handler_name=None,
iterator=iterator,
play_context=play_context,
notified_hosts=included_file._hosts[:],

View file

@ -139,8 +139,14 @@ class StrategyModule(StrategyBase):
host_results.extend(results)
try:
included_files = IncludedFile.process_include_results(host_results, self._tqm, iterator=iterator,
loader=self._loader, variable_manager=self._variable_manager)
included_files = IncludedFile.process_include_results(
host_results,
self._tqm,
iterator=iterator,
inventory=self._inventory,
loader=self._loader,
variable_manager=self._variable_manager
)
except AnsibleError as e:
return False

View file

@ -261,8 +261,14 @@ class StrategyModule(StrategyBase):
break
try:
included_files = IncludedFile.process_include_results(host_results, self._tqm,
iterator=iterator, loader=self._loader, variable_manager=self._variable_manager)
included_files = IncludedFile.process_include_results(
host_results,
self._tqm,
iterator=iterator,
inventory=self._inventory,
loader=self._loader,
variable_manager=self._variable_manager
)
except AnsibleError as e:
return False