On Wed, 15 Jun 2022 01:13:17 -0500
"Hugo F. Gonzalez" <[email protected]> wrote:

> {% for group, values in (list | groupby('group') %}
> {{ group }}:{% for item in value %}{{ item }},{% endfor %}
> {% endfor %}

The template can be fixed

  {% for group, values in _list|groupby('group') %}
  {{ group }}: {{ values|map(attribute='name')|join(',') }}
  {% endfor %}

to get the expected result

  g1: n1,n2
  g2: c1


-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/20220615100211.4450c087%40gmail.com.

Attachment: pgpMR7gcQReZU.pgp
Description: OpenPGP digital signature

Reply via email to