Hi Kai,
Thank you so much. I would never have figured that out. The result is
however still a bit off:
TASK [debug]
************************************************************************************************************************
ok: [localhost] => {
"foo": "[u'10.1.1.7']:8080,[u'10.1.1.4']:8080,[u'10.1.1.5']:8080"
}
fredag den 20. april 2018 kl. 13.00.32 UTC+2 skrev Kai Stian Olstad:
>
> On 20.04.2018 12:33, Nico wrote:
> > I need to create a loop that puts the list into a string.
> > - set_fact:
> > foo: "{{ item }}:8080"
> > with_items: "{{ ip_list }}"
> >
> > Does anybody know how to do this?
>
> - set_fact:
> foo: '{% for i in ip %}{{ i }}:8080{% if not loop.last %},{% endif
> %}{% endfor %}'
>
> --
> Kai Stian Olstad
>
--
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/d0751f0c-3640-4b76-88f0-e3ed3ffd9d36%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.