From 8f1b48714113538ae71eaf7c12199a788a00738a Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Tue, 28 Jun 2016 15:55:46 -0700 Subject: [PATCH] Handle repeat includes in junit callback. (#16484) --- lib/ansible/plugins/callback/junit.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/ansible/plugins/callback/junit.py b/lib/ansible/plugins/callback/junit.py index d5b4df6714..067c7551b0 100644 --- a/lib/ansible/plugins/callback/junit.py +++ b/lib/ansible/plugins/callback/junit.py @@ -237,7 +237,11 @@ class TaskData: def add_host(self, host): if host.uuid in self.host_data: - raise Exception('%s: %s: %s: duplicate host callback: %s' % (self.path, self.play, self.name, host.name)) + if host.status == 'included': + # concatenate task include output from multiple items + host.result = '%s\n%s' % (self.host_data[host.uuid].result, host.result) + else: + raise Exception('%s: %s: %s: duplicate host callback: %s' % (self.path, self.play, self.name, host.name)) self.host_data[host.uuid] = host