- set_fact:
    zk_connection_: >
      {%- set servers = [] %}
      {%- for host in groups['zk_servers'] %}
      {%-    set _ = servers.append(hostvars[host]['ansible_' 
+iface]['ipv4']['address']) %}
      {%- endfor %}
      {{- servers -}}


Is how I have done it. I got some help on IRC to solve the initials, and 
now I use this jinja2 inline template instead of doing it through a proper 
template and load the result as a variable. Guess you can swap the 
'groups['zk_servers'] with your variable and the append part you will have 
to figure out yourself :-)

HTH
-- 
Olve

On Wednesday, September 16, 2015 at 3:24:38 PM UTC+2, trupti mali wrote:
>
> Oh well I guessed so. Then how to solve this problem of concatenating 
> values by iterating in a with_items loop?
>
>
>
> On Tuesday, 15 September 2015 19:22:55 UTC+5:30, Brian Coca wrote:
>>
>> I did not realize, you are self referencing exceptions, that won't work 
>>
>> -- 
>> Brian Coca 
>>
>

-- 
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/b5527bd3-d4a5-46ff-8363-4a209c925ce3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to