Don't look for ansible_host unconditionally
We do this same fallback in other places, and see warnings in the executor log about hitting this. Change-Id: Ic9d27a7d3299c8f32fb6d1104dbda4bf5b76c54a
This commit is contained in:
parent
1d0bcea15c
commit
9db79043f7
|
@ -204,7 +204,8 @@ class CallbackModule(default.CallbackModule):
|
|||
else:
|
||||
task_host = result._host.get_name()
|
||||
task_hostvars = result._task._variable_manager._hostvars[task_host]
|
||||
if task_hostvars['ansible_host'] in localhost_names:
|
||||
if task_hostvars.get('ansible_host', task_hostvars.get(
|
||||
'ansible_inventory_host')) in localhost_names:
|
||||
is_localhost = True
|
||||
|
||||
if not is_localhost and is_task:
|
||||
|
|
Loading…
Reference in New Issue