From dc430ae15e7f0224e17462ab0e495e5e59fd8ed1 Mon Sep 17 00:00:00 2001 From: Ondrej Prazak Date: Wed, 17 Apr 2019 14:26:19 +0200 Subject: [PATCH] Add reporter to report logs sent by foreman callback When ansible fails to connect to remote host, callback sends a report to Foreman without any indication that the report comes from Ansible. As a result, Foreman is unable to determine the report origin. This adds a 'reporter' attribute into the logs that are sent. --- plugins/callback/foreman.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/callback/foreman.py b/plugins/callback/foreman.py index eef2ac1ed6..9321bd84c0 100644 --- a/plugins/callback/foreman.py +++ b/plugins/callback/foreman.py @@ -179,7 +179,8 @@ def _build_log(self, data): 'messages': { 'message': json.dumps(msg) }, - 'level': level + 'level': level, + 'reporter': 'ansible' } }) return logs