Hello,
I am struggling to come up the syntax for the following:
/vars/main.yml
interface:
- eth1
- eth2
details:
- { ip_address: 1.1.1.1, otherdetails:..... }
- { ip_address: 2.2.2.2, otherdetails:...... }
I want a loop that can take interface: and then details: and insert into a
/templates/template.j2 file.
{{interface}} {{item.ip_address}}
However, the file continually overwrites the previous version with the
latest information i.e eth2 2.2.2.2 in this instance.
Is there a way to loop over the entries so I can get the desired output of
below to a single file:
eth1 1.1.1.1
eth2 2.2.2.2
thanks.
--
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/0d8d59bc-db8a-4d47-8e12-d5ee649f3a72%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.