However, this can be used without any problem for other types of interfaces like bond, vlan and remaining managed.interfaces.
Is this effectively something missing in the product?
Anyway, currently I have something working (not the best way of coding due to missing knowledge of erb, and for now only for ipv4 config), see example-result conform the netplan-syntaxes, and tested on a ubuntu 20 system (installed manually):
In the error it says bridge_dhcp6 but in this code I don’t see it. Does it perhaps happen elsewhere? Perhaps you intended bridge_dhcp6 = ... instead of bridge_dhcp = ...?
It would be awesome if you could share the entire template, ideally as a pull request upstream so all users can benefit from it.
OMG, I over looked this one, thanks for pointing this out to me.
Using the correct variable-name makes a difefrence.
Before sharing/uploading the template I’m going to try making the code shorter by using a snippet in order to use it for repeating code as function, and add also the code for ipv6.
Another question:
I was looking for a way to check whether there is a simple way to find out if interfaces of a certain type (bonds, bridges or vlans) are defined.
When I try to use for example:
<%- if !@host.bond_interfaces.nil? -%>
or
<%- if !@host.bond_interfaces.blank? -%>
It returns true, even when there are no interfaces in it when using it in a loop <%- @host.bond_interfaces.each do | bond | -%>.