Fixups for new network device naming

This commit is contained in:
Gregory Kurtzer
2021-10-23 08:52:43 -07:00
parent 1370932cd3
commit fcd654af80
2 changed files with 7 additions and 4 deletions

View File

@@ -161,11 +161,14 @@ func buildOverlay(nodeList []node.NodeInfo, overlayType string) error {
var nd node.NetDevs
t.NetDevs[devname] = &nd
t.NetDevs[devname].Name = devname
t.NetDevs[devname].Device = netdev.Device.Get()
t.NetDevs[devname].Hwaddr = netdev.Hwaddr.Get()
t.NetDevs[devname].Ipaddr = netdev.Ipaddr.Get()
t.NetDevs[devname].Netmask = netdev.Netmask.Get()
t.NetDevs[devname].Gateway = netdev.Gateway.Get()
t.NetDevs[devname].Type = netdev.Type.Get()
t.NetDevs[devname].OnBoot = netdev.OnBoot.GetB()
mask := net.IPMask(net.ParseIP(netdev.Netmask.Get()).To4())
ipaddr := net.ParseIP(netdev.Ipaddr.Get()).To4()
netaddr := net.IPNet{IP: ipaddr, Mask: mask}

View File

@@ -1,4 +1,4 @@
DEVICE={{.NetDevs.default.Device}}
DEVICE={{$.NetDevs.default.Device}}
NAME=default
BOOTPROTO=static
DEVTIMEOUT=10
@@ -6,8 +6,8 @@ IPADDR={{$.NetDevs.default.Ipaddr}}
NETMASK={{$.NetDevs.default.Netmask}}
GATEWAY={{$.NetDevs.default.Gateway}}
HWADDR={{$.NetDevs.default.Hwaddr}}
{{if eq $.NetDevs.default.OnBoot "true"}}
{{- if $.NetDevs.default.OnBoot}}
ONBOOT=yes
{{else}}
{{- else}}
ONBOOT=no
{{end}}
{{- end}}