Conversation
Notices
-
Embed this notice
feld (feld@friedcheese.us)'s status on Friday, 31-Jan-2025 07:59:00 JST feld
@dvl so, vlan.id is the number you need so you'll have to inject some code into this template to construct what you want. the following syntax is 100% wrong but should get you into the right mindset
{% cloned_interfaces = for vlan in vlans ... somehow make "vlan" + vlan.id endfor.join(" ") %}-
Embed this notice
Thomas Steen Rasmussen (tykling@mastodon.social)'s status on Friday, 31-Jan-2025 15:14:41 JST Thomas Steen Rasmussen
https://github.com/tykling/ansible-roles/blob/master/freebsd_host/templates/netif.j2#L6 i do this @dvl @feld
feld likes this. -
Embed this notice
feld (feld@friedcheese.us)'s status on Friday, 31-Jan-2025 15:15:21 JST feld
@tykling @dvl i didn't expect that syntax to be allowed but I haven't needed to write a lot of Jinja I guess. That looks like it will do it! In conversation permalink
-
Embed this notice