Thank you so much that worked like a charm. This was my first successful
playbook :-)
On Thursday, February 18, 2021 at 9:47:30 AM UTC-8 dick@geant.org wrote:
> This is because your data is json formatted, but your debug uses yaml
> to display.
> It could be as simple as adding the
This is because your data is json formatted, but your debug uses yaml
to display.
It could be as simple as adding the to_nice_yaml filter, i.e.:
- name: copy the output
copy:
content: "{{ result | to_nice_yaml }}"
dest: "/home/sameer/Documents/icx.txt"
delegate_to:
Sorry for being little ambiguous.
Here is the output of my file when I read it. It is all clubbed together
with newline \n and no proper formatting.
===
more icx.txt
{"ansible_facts": {"ansible_net_gather_subset": ["config",
On Wed, 17 Feb 2021 at 22:09, Sameer Nagwekar
wrote:
> I am able to run this playbook it copies the file to destination folder
> but it has all the special characters and the text is not in readable
> format. Any help in formatting the output file?
>
"special characters" is a bit ambiguous.
I am able to run this playbook it copies the file to destination folder but
it has all the special characters and the text is not in readable format.
Any help in formatting the output file?
tasks:
- name: collect the config facts
icx_facts:
gather_subset:
- config