# Ansible log plugin to output XML

**URL:** <https://forum.ansible.com/t/ansible-log-plugin-to-output-xml/14808>\
**Category:** Ansible Project\
**Created:** [March 19, 2014, 4:55pm UTC](https://forum.ansible.com/t/ansible-log-plugin-to-output-xml/14808 "2014-03-19T16:55:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mark\_Phillips](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@Mark\_Phillips](https://forum.ansible.com/u/Mark_Phillips)\
**Post date:** [March 19, 2014, 4:55pm UTC](https://forum.ansible.com/t/ansible-log-plugin-to-output-xml/14808/1 "2014-03-19T16:55:49Z")

</div>

Hello folks,

Not something I’d ordinarily advocate - XML (eugh) - but I was wondering if anybody had done anything with producing run log output as XML?

I’m looking at it so I can plug Ansible testing into a CI solution, in this case specifically Bamboo. I can make use of the JUnit processor with XML output.

Before I start faffing about actually doing this, I was wondering if anybody had done anything similar - even if it’s with Jenkins or the likes.

Cheers,

–Mark

---

<div class="post-metadata">

**Author:** ![Sergio\_Freire](https://avatars.discourse-cdn.com/v4/letter/s/b38774/32.png) [@Sergio\_Freire](https://forum.ansible.com/u/Sergio_Freire)\
**Post date:** [March 29, 2014, 10:12pm UTC](https://forum.ansible.com/t/ansible-log-plugin-to-output-xml/14808/2 "2014-03-29T22:12:10Z")

</div>

Hello,  
i’m also searching for the same but still with no luck. I saw some wrappers using perl test::unit and prove but I personaly don’t like that solution  
Regards,  
Sergio

---

<div class="post-metadata">

**Author:** ![Mark\_Phillips](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@Mark\_Phillips](https://forum.ansible.com/u/Mark_Phillips)\
**Post date:** [March 31, 2014, 7:42pm UTC](https://forum.ansible.com/t/ansible-log-plugin-to-output-xml/14808/3 "2014-03-31T19:42:45Z")

</div>

Hello Sergio,

Where did you see that solution? Wouldn’t have a link you could share would you please?

TBH anything would be a good start. There is a TAP plugin for Bamboo, so a wrapper outputting TAP would be great (I actually started to look at PyTAP yesterday, and wondered if I could make use of callbacks to output TAP formatted checks to --list-tasks --list-hosts --syntax-check)

Cheers

---

<div class="post-metadata">

**Author:** ![Serge\_van\_Ginderacht](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@Serge\_van\_Ginderacht](https://forum.ansible.com/u/Serge_van_Ginderacht)\
**Post date:** [March 31, 2014, 7:47pm UTC](https://forum.ansible.com/t/ansible-log-plugin-to-output-xml/14808/4 "2014-03-31T19:47:02Z")

</div>

​Nothing concretely, but you might want to look at callback\_plugins to  
interface your xml, I think.​

---

<div class="post-metadata">

**Author:** ![cxh](https://avatars.discourse-cdn.com/v4/letter/c/b5a626/32.png) [@cxh](https://forum.ansible.com/u/cxh)\
**Post date:** [April 30, 2015, 10:50pm UTC](https://forum.ansible.com/t/ansible-log-plugin-to-output-xml/14808/5 "2015-04-30T22:50:22Z")

</div>

Sorry to answer an old thread, but when I search for Ansible JUnit output, this thread comes up.

I hacked up a script that generates JUnit XML output from an Ansible run, see [https://gist.github.com/cxbrooks/a6e6ce6013e7324398ea](https://gist.github.com/cxbrooks/a6e6ce6013e7324398ea)

\_Christopher

---

<div class="post-metadata">

**Author:** ![cxh](https://avatars.discourse-cdn.com/v4/letter/c/b5a626/32.png) [@cxh](https://forum.ansible.com/u/cxh)\
**Post date:** [April 30, 2015, 11:21pm UTC](https://forum.ansible.com/t/ansible-log-plugin-to-output-xml/14808/6 "2015-04-30T23:21:29Z")

</div>

The formatting was messed up the gist. Copy and paste from Emacs was not pretty.

I’ve created [https://github.com/cxbrooks/ansible-junitxml](https://github.com/cxbrooks/ansible-junitxml) and done a pull request to the master at [https://github.com/seancron/ansible-junitxml](https://github.com/seancron/ansible-junitxml)
