On Fri, 20 Oct 2023 08:40:56 -0700 (PDT)
Veera <sveem...@gmail.com> wrote:

> the "cols" are printed as like below (not as [green, red, yellow, 
> blue]).
> ...
>     "msg": [
>         [
>             "green",
>             "toronto",
>             "English"
>         ],
>         [
>             "red",
>             "montreal",
>             "French"
>         ],
>         [
>             "yellow",
>             "mumbai",
>             "Hindi"
>         ],
>         [
>             "blue",
>             "dubai",
>             "Arabic"
>         ]
>     ]

> > On Fri, 20 Oct 2023, 16:08 Vladimir Botka <vbo...@gmail.com> wrote:
> >  
> >>   msg: |-
> >>     color    cities     lang
> >>     green    toronto    English
> >>     red      montreal   French
> >>     yellow   mumbai     Hindi
> >>     blue     dubai      Arabic

What you see depends on the callback. Try

  shell> ANSIBLE_STDOUT_CALLBACK=yaml ansible-playbook playbook.yml

Learn about formatting:

* Try filters: *to_yaml*, *to_nice_yaml*. Try the option *indent*
* Try the filter *indent*
* Try other callbacks

Links:

https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_filters.html#formatting-data-yaml-and-json
https://jinja.palletsprojects.com/en/latest/templates/#jinja-filters.indent
https://docs.ansible.com/ansible/latest/plugins/callback.html
https://docs.ansible.com/ansible/latest/collections/index_callback.html
https://docs.ansible.com/ansible/latest/reference_appendices/config.html#default-stdout-callback


-- 
Vladimir Botka

-- 
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-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/20231020195605.25f8d502%40gmail.com.

Attachment: pgpT7h2SWla05.pgp
Description: OpenPGP digital signature

Reply via email to