Hi,

I've had this problem came up a few times and hope someone here has a
solution for it.

I have a basic for loop in a template where multiple lines are printed per
loop. The problem is that I'd like similar lines to be grouped.

Example:

*myvar:*
*  - {name: one, value: 1} *
*  - {name: two, value: 2}*

*{% for v in myvar %}*
*name is {{v.name <http://v.name>}}*
*val is {{v.value}}*
*{% endfor %}*

That generates:

*name is one*
*value is one*
*name is two*
*value is two*

What I would like:

*name is one*
*name is two*
*value is two*
*value is one*

is this possible without a double loop each one containing a line?

thanks,

Spike

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAPE6YbQszc-Eq8o%3DWCmAr5b%2BuGBNWSeqARmpDynuevfyEi%2BfVA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to