From 9db79043f7a63089e94881f7bdd23be27a4c6853 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Sun, 9 Jul 2017 09:55:35 -0500 Subject: [PATCH] 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 --- zuul/ansible/callback/zuul_stream.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zuul/ansible/callback/zuul_stream.py b/zuul/ansible/callback/zuul_stream.py index fb15f1c36b..2f743b483f 100644 --- a/zuul/ansible/callback/zuul_stream.py +++ b/zuul/ansible/callback/zuul_stream.py @@ -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: