Fixups for new network device naming
This commit is contained in:
@@ -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}
|
||||
|
||||
@@ -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}}
|
||||
|
||||
Reference in New Issue
Block a user