On 21.07.2016 09:32, ishan jain wrote:
On Thursday, 21 July 2016 12:44:07 UTC+5:30, Kai Stian Olstad wrote:
On 21.07.2016 08:28, ishan jain wrote:
> So, does anyone has an idea how i can generate a report in the end
> after
> collecting output of multiple commands ?
Template?
https://docs.ansible.com/ansible/template_module.html
I can see a few problems with the templates:
- I want the report on Ansible host machine and not on target machines
This is the easy part, add delegate_to: localhost on the template.
https://docs.ansible.com/ansible/playbooks_delegation.html#delegation
- Seems like a difficult job to consolidate report within template for
each
target host.
For eg this kind of report:
Check number 1
[host 1]: OK
[host 2]: Failed
This would involve hostvars and for loops in the template.
- I do not have extensive knowledhe of jinja2 templates and seems like
i
will have to learn a few things to create a report template
It will be rewarding in the end, you can do a lot of things with jinja2
and templates.
--
Kai Stian Olstad
--
You received this message because you are subscribed to the Google Groups "Ansible
Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/3147d62f46202aa36536c81ceff069f8%40olstad.com.
For more options, visit https://groups.google.com/d/optout.