Ansible log plugin to output XML

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

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

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

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

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

_Christopher

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

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