You may want something like this (untested):

{% for host in groups['fusemq'] %} tcp://{{ host }}{% if not loop.last %},
{% endif %}{% endfor %}


On Thu, Jun 26, 2014 at 9:43 AM, jepper <[email protected]> wrote:

> Will that not generate a list as follows
>
> fusemq01, fusemq02
>
> it does not take into account "tcp://"
>
>
> On Thursday, 26 June 2014 14:20:21 UTC+1, Enrique Paredes wrote:
>
>> Try the join filter in Jinja:
>>
>> {{ groups['fusemq']|join(' ,') }}
>>
>>
>>
>> 2014-06-26 15:06 GMT+02:00 jepper <[email protected]>:
>>
>>> In a template, I loop over a group of fusemq hosts defined in my
>>> invetory file e.g.
>>>
>>> fuseMQ_URL=failover:( {% for host in groups['fusemq'] %} tcp://{{ host
>>> }}, {% endfor %} )
>>>
>>> The result is of course, a trailing comma - how can I avoid this?
>>>
>>> fuseMQ_URL=failover:(  tcp://fusemq01, tcp://fusemq02,  )
>>>
>>> --
>>> 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 post to this group, send email to [email protected].
>>>
>>> To view this discussion on the web visit https://groups.google.com/d/
>>> msgid/ansible-project/8718c489-3551-41e8-a1e7-
>>> 4a73cfa461d4%40googlegroups.com
>>> <https://groups.google.com/d/msgid/ansible-project/8718c489-3551-41e8-a1e7-4a73cfa461d4%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>  --
> 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 post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/046a7f96-7968-41e3-9849-b0ffb8710fa6%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/046a7f96-7968-41e3-9849-b0ffb8710fa6%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAPcsqx%3DSZfDnKN_VCfyC0uFzNiyqAzQQhhj4xizNEj1zMcmdiA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to