--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/35a3b1fc-da7b-4f4b-a2be-ebd9bf89c49b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hello,
I've seen this use case before. It's easier to build the
reporting directly into the playbook. You can, for exmaple, create
a template that will print what you want for each managed host,
and assemble the pieces later:
The example below is a yaml file to gather data from a Juniper Networks Switch device.How would you do it this?
I've seen this exact same use case. It's better to build the reporting directly into the playbook. You can, for exaple, create a template that will print what you want for each managed host, and assemble the pieces later:
Something like adding a template file like:
{{ inventory_hostname }} :
{{ response }}
Then templating it:
- name: create part of the report for {{ inventory_hostname }}
template:
src: my_template.j2
dest: "{{ inventory_hostname.report }}"
Then you can use the fetch module to bring it over to the controller and the assemble module to generate a full report.
Hope that helps,
Hugo
On Wednesday, February 13, 2019 at 8:45:06 AM UTC-5, DM wrote:How do you write to a file the output of a yaml?
If possible, how do you only write to a file specific info if?
Thanks
--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/a61598d0-736e-43e2-9b10-a07981c9e3cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.