Ansible - generate reports

Hi to all,

I need some ideas about my problem, so if anybody has some ideas I would be very gratefull.

I want to generate some report on ansible server.
My idea is to create custom facts which gather some information on some hosts.
That information (facts) would be input for my html report about all hosts from where I gather facts.
So, first task would be gather custom facts which I run on some group.
My question is, how to use that collected facts to locally (on ansible server) populate some html template (jinja2).

Or more specifically, let say I have custom facts which generate following output.

“ansible_local”: {
getFacts: [
{
“var1”: “valueOne”,
“var2”: “valueTwo”
},
{
“valueDict”: {
“dictVar1”: “dictValueOne”,
“dictVar1”: “dictValueOne”

}
}
]
}

So when I run setup module on multiple hosts, which result is previous facts, how to use all that facts to generate one report with all values.

host var1
hostname1 valueOne
hostname2 valueTwo
hostname3 valueThree

Thanks in advance…

This project takes collected facts and generates a single-page html report from them, so probably worth you having a look at (or just using):

https://github.com/fboender/ansible-cmdb

Hope this helps,

Jon