diff --git a/cmd/update_configuration/update_configuration.go b/cmd/update_configuration/update_configuration.go index f1532851..2ddd79ae 100644 --- a/cmd/update_configuration/update_configuration.go +++ b/cmd/update_configuration/update_configuration.go @@ -104,7 +104,7 @@ func update42to43(conf42 vers42.NodeConf) vers43.NodeConf { var device vers43.NetDevs = vers43.NetDevs{ Type: netdev.Type, Device: devn, - Default: printB(netdev.Default), + Primary: printB(netdev.Default), Hwaddr: netdev.Hwaddr, Ipaddr: netdev.Ipaddr, IpCIDR: netdev.IpCIDR, diff --git a/cmd/update_configuration/vers43/datastructure.go b/cmd/update_configuration/vers43/datastructure.go index eda98449..48712bc5 100644 --- a/cmd/update_configuration/vers43/datastructure.go +++ b/cmd/update_configuration/vers43/datastructure.go @@ -60,6 +60,6 @@ type NetDevs struct { Prefix string `yaml:"prefix,omitempty"` Netmask string `yaml:"netmask,omitempty"` Gateway string `yaml:"gateway,omitempty"` - Default string `yaml:"default,omitempty"` + Primary string `yaml:"primary,omitempty"` Tags map[string]string `yaml:"tags,omitempty"` } diff --git a/internal/app/wwctl/container/imprt/main.go b/internal/app/wwctl/container/imprt/main.go index 305c0d8c..09596279 100644 --- a/internal/app/wwctl/container/imprt/main.go +++ b/internal/app/wwctl/container/imprt/main.go @@ -130,8 +130,8 @@ func CobraRunE(cmd *cobra.Command, args []string) error { wwlog.Warn("Could not copy /etc/resolv.conf into container: %s", err) } - err = container.SyncUids(name, !NoSyncUser) - if err != nil && !NoSyncUser { + err = container.SyncUids(name, !SyncUser) + if err != nil && !SyncUser { wwlog.Error("Error in user sync, fix error and run 'syncuser' manually: %s", err) os.Exit(1) } diff --git a/internal/app/wwctl/container/imprt/root.go b/internal/app/wwctl/container/imprt/root.go index ccbd8cde..6951849d 100644 --- a/internal/app/wwctl/container/imprt/root.go +++ b/internal/app/wwctl/container/imprt/root.go @@ -24,7 +24,7 @@ Imported containers are used to create bootable VNFS images.`, SetUpdate bool SetBuild bool SetDefault bool - NoSyncUser bool + SyncUser bool ) func init() { @@ -32,7 +32,7 @@ func init() { baseCmd.PersistentFlags().BoolVarP(&SetUpdate, "update", "u", false, "Update and overwrite an existing container") baseCmd.PersistentFlags().BoolVarP(&SetBuild, "build", "b", false, "Build container when after pulling") baseCmd.PersistentFlags().BoolVar(&SetDefault, "setdefault", false, "Set this container for the default profile") - baseCmd.PersistentFlags().BoolVar(&NoSyncUser, "nosyncuser", false, "Don't synchronize uis/gods from host to container") + baseCmd.PersistentFlags().BoolVar(&SyncUser, "syncuser", false, "Synchronize uis/gods from host to container") } // GetRootCommand returns the root cobra.Command for the application. diff --git a/internal/app/wwctl/container/syncuser/main.go b/internal/app/wwctl/container/syncuser/main.go index 04be7b32..e83fd6cc 100644 --- a/internal/app/wwctl/container/syncuser/main.go +++ b/internal/app/wwctl/container/syncuser/main.go @@ -14,7 +14,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error { if !container.ValidName(containerName) { return fmt.Errorf("%s is not a valid container", containerName) } - err := container.SyncUids(containerName, noSyncUser) + err := container.SyncUids(containerName, !write) if err != nil { wwlog.Printf(wwlog.ERROR, "Error in synchronize: %s\n", err) os.Exit(1) diff --git a/internal/app/wwctl/container/syncuser/root.go b/internal/app/wwctl/container/syncuser/root.go index eb654b55..00cc0a18 100644 --- a/internal/app/wwctl/container/syncuser/root.go +++ b/internal/app/wwctl/container/syncuser/root.go @@ -24,11 +24,11 @@ uid/gid collision is detected. File ownerships are also changed.`, Args: cobra.MinimumNArgs(1), } - noSyncUser bool + write bool ) func init() { - baseCmd.PersistentFlags().BoolVar(&noSyncUser, "nosyncuser", false, "Don't synchronize uis/gods just check") + baseCmd.PersistentFlags().BoolVar(&write, "write", false, "Synchronize uis/gids and write files in container") } // GetRootCommand returns the root cobra.Command for the application. diff --git a/internal/app/wwctl/node/list/main.go b/internal/app/wwctl/node/list/main.go index 75f06d34..304404fe 100644 --- a/internal/app/wwctl/node/list/main.go +++ b/internal/app/wwctl/node/list/main.go @@ -71,7 +71,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error { fmt.Printf("%-20s %-18s %-12s %s\n", node.Id.Get(), name+":GATEWAY", netdev.Gateway.Source(), netdev.Gateway.Print()) fmt.Printf("%-20s %-18s %-12s %s\n", node.Id.Get(), name+":TYPE", netdev.Type.Source(), netdev.Type.Print()) fmt.Printf("%-20s %-18s %-12s %s\n", node.Id.Get(), name+":ONBOOT", netdev.OnBoot.Source(), netdev.OnBoot.PrintB()) - fmt.Printf("%-20s %-18s %-12s %s\n", node.Id.Get(), name+":DEFAULT", netdev.Default.Source(), netdev.Default.PrintB()) + fmt.Printf("%-20s %-18s %-12s %s\n", node.Id.Get(), name+":PRIMARY", netdev.Primary.Source(), netdev.Primary.PrintB()) for keyname, key := range netdev.Tags { fmt.Printf("%-20s %-18s %-12s %s\n", node.Id.Get(), name+":TAG["+keyname+"]", key.Source(), key.Print()) } diff --git a/internal/app/wwctl/node/set/main.go b/internal/app/wwctl/node/set/main.go index e1da70d7..b098c53a 100644 --- a/internal/app/wwctl/node/set/main.go +++ b/internal/app/wwctl/node/set/main.go @@ -188,13 +188,13 @@ func CobraRunE(cmd *cobra.Command, args []string) error { SetNetOnBoot = "yes" for _, n := range n.NetDevs { - if n.Default.GetB() { + if n.Primary.GetB() { def = false } } if def { - SetNetDefault = "yes" + SetNetPrimary = "yes" } } @@ -276,24 +276,24 @@ func CobraRunE(cmd *cobra.Command, args []string) error { } } - if SetNetDefault != "" { + if SetNetPrimary != "" { if SetNetName == "" { wwlog.Printf(wwlog.ERROR, "You must include the '--netname' option\n") os.Exit(1) } - if SetNetDefault == "yes" || SetNetDefault == "y" || SetNetDefault == "1" || SetNetDefault == "true" { + if SetNetPrimary == "yes" || SetNetPrimary == "y" || SetNetPrimary == "1" || SetNetPrimary == "true" { // Set all other devices to non-default for _, n := range n.NetDevs { - n.Default.SetB(false) + n.Primary.SetB(false) } wwlog.Printf(wwlog.VERBOSE, "Node: %s:%s, Setting PRIMARY\n", n.Id.Get(), SetNetName) - n.NetDevs[SetNetName].Default.SetB(true) + n.NetDevs[SetNetName].Primary.SetB(true) } else { wwlog.Printf(wwlog.VERBOSE, "Node: %s:%s, Unsetting PRIMARY\n", n.Id.Get(), SetNetName) - n.NetDevs[SetNetName].Default.SetB(false) + n.NetDevs[SetNetName].Primary.SetB(false) } } diff --git a/internal/app/wwctl/node/set/root.go b/internal/app/wwctl/node/set/root.go index d6eb7bf7..0174d55e 100644 --- a/internal/app/wwctl/node/set/root.go +++ b/internal/app/wwctl/node/set/root.go @@ -44,7 +44,7 @@ var ( SetHwaddr string SetType string SetNetOnBoot string - SetNetDefault string + SetNetPrimary string SetNetDevDel bool SetClusterName string SetIpxe string @@ -143,7 +143,7 @@ func init() { baseCmd.PersistentFlags().StringVarP(&SetHwaddr, "hwaddr", "H", "", "Set the node's network device HW address") baseCmd.PersistentFlags().StringVarP(&SetType, "type", "T", "", "Set the node's network device type") baseCmd.PersistentFlags().StringVar(&SetNetOnBoot, "onboot", "", "Enable/disable device (yes/no)") - baseCmd.PersistentFlags().StringVar(&SetNetDefault, "primary", "", "Enable/disable device as primary (yes/no)") + baseCmd.PersistentFlags().StringVar(&SetNetPrimary, "primary", "", "Enable/disable device as primary (yes/no)") baseCmd.PersistentFlags().BoolVar(&SetNetDevDel, "netdel", false, "Delete the node's network device") baseCmd.PersistentFlags().StringSliceVar(&SetNetTags, "nettag", []string{}, "Define custom tag to network device (key=value)") diff --git a/internal/app/wwctl/overlay/build/main.go b/internal/app/wwctl/overlay/build/main.go index 4bb6a559..484d249e 100644 --- a/internal/app/wwctl/overlay/build/main.go +++ b/internal/app/wwctl/overlay/build/main.go @@ -7,6 +7,7 @@ import ( "github.com/hpcng/warewulf/internal/pkg/node" "github.com/hpcng/warewulf/internal/pkg/overlay" + "github.com/hpcng/warewulf/internal/pkg/util" "github.com/hpcng/warewulf/internal/pkg/warewulfconf" "github.com/hpcng/warewulf/internal/pkg/wwlog" "github.com/hpcng/warewulf/pkg/hostlist" @@ -37,7 +38,12 @@ func CobraRunE(cmd *cobra.Command, args []string) error { if len(args) > 0 { args = hostlist.Expand(args) for _, node := range nodes { - return overlay.BuildOverlayIndir(node, strings.Split(OverlayName, ","), OverlayDir) + if util.InSlice(node.RuntimeOverlay.GetSlice(), OverlayName) || + util.InSlice(node.SystemOverlay.GetSlice(), OverlayName) { + return overlay.BuildOverlayIndir(node, strings.Split(OverlayName, ","), OverlayDir) + } else { + return errors.New("no node uses the given overlay") + } } } else { var host node.NodeInfo @@ -68,7 +74,12 @@ func CobraRunE(cmd *cobra.Command, args []string) error { } } else { if OverlayName != "" { - err = overlay.BuildSpecificOverlays(nodes, OverlayName) + for _, n := range nodes { + if util.InSlice(n.RuntimeOverlay.GetSlice(), OverlayName) || + util.InSlice(n.SystemOverlay.GetSlice(), OverlayName) { + err = overlay.BuildSpecificOverlays([]node.NodeInfo{n}, OverlayName) + } + } } else { err = overlay.BuildAllOverlays(nodes) } diff --git a/internal/app/wwctl/profile/list/main.go b/internal/app/wwctl/profile/list/main.go index a5eecb85..7e8d7163 100644 --- a/internal/app/wwctl/profile/list/main.go +++ b/internal/app/wwctl/profile/list/main.go @@ -62,7 +62,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error { fmt.Printf("%-20s %-18s %s\n", profile.Id.Get(), name+":HWADDR", netdev.Hwaddr.Print()) fmt.Printf("%-20s %-18s %s\n", profile.Id.Get(), name+":TYPE", netdev.Hwaddr.Print()) fmt.Printf("%-20s %-18s %s\n", profile.Id.Get(), name+":ONBOOT", netdev.OnBoot.PrintB()) - fmt.Printf("%-20s %-18s %s\n", profile.Id.Get(), name+":DEFAULT", netdev.Default.PrintB()) + fmt.Printf("%-20s %-18s %s\n", profile.Id.Get(), name+":PRIMARY", netdev.Primary.PrintB()) for keyname, key := range netdev.Tags { fmt.Printf("%-20s %-18s %-12s %s\n", profile.Id.Get(), name+":TAG["+keyname+"]", key.Source(), key.Print()) } diff --git a/internal/app/wwctl/profile/set/main.go b/internal/app/wwctl/profile/set/main.go index e217ed4c..6fec3326 100644 --- a/internal/app/wwctl/profile/set/main.go +++ b/internal/app/wwctl/profile/set/main.go @@ -211,24 +211,24 @@ func CobraRunE(cmd *cobra.Command, args []string) error { } } - if SetNetDefault != "" { + if SetNetPrimary != "" { if SetNetName == "" { wwlog.Printf(wwlog.ERROR, "You must include the '--netname' option\n") os.Exit(1) } - if SetNetDefault == "yes" || SetNetDefault == "y" || SetNetDefault == "1" || SetNetDefault == "true" { + if SetNetPrimary == "yes" || SetNetPrimary == "y" || SetNetPrimary == "1" || SetNetPrimary == "true" { // Set all other networks to non-default for _, n := range p.NetDevs { - n.Default.SetB(false) + n.Primary.SetB(false) } wwlog.Printf(wwlog.VERBOSE, "Profile: %s:%s, Setting PRIMARY\n", p.Id.Get(), SetNetName) - p.NetDevs[SetNetName].Default.SetB(true) + p.NetDevs[SetNetName].Primary.SetB(true) } else { wwlog.Printf(wwlog.VERBOSE, "Profile: %s:%s, Unsetting PRIMARY\n", p.Id.Get(), SetNetName) - p.NetDevs[SetNetName].Default.SetB(false) + p.NetDevs[SetNetName].Primary.SetB(false) } } diff --git a/internal/app/wwctl/profile/set/root.go b/internal/app/wwctl/profile/set/root.go index e586314c..e15d28d5 100644 --- a/internal/app/wwctl/profile/set/root.go +++ b/internal/app/wwctl/profile/set/root.go @@ -57,7 +57,7 @@ var ( SetGateway string SetType string SetNetOnBoot string - SetNetDefault string + SetNetPrimary string SetNetDevDel bool SetDiscoverable bool SetUndiscoverable bool @@ -118,7 +118,7 @@ func init() { baseCmd.PersistentFlags().StringVarP(&SetNetName, "netname", "n", "default", "Define the network name to configure") baseCmd.PersistentFlags().StringVarP(&SetNetDev, "netdev", "N", "", "Set the node's network device") - baseCmd.PersistentFlags().StringVar(&SetNetDefault, "primary", "", "Enable/disable device as primary (yes/no)") + baseCmd.PersistentFlags().StringVar(&SetNetPrimary, "primary", "", "Enable/disable device as primary (yes/no)") baseCmd.PersistentFlags().StringVarP(&SetNetmask, "netmask", "M", "", "Set the node's network device netmask") baseCmd.PersistentFlags().StringVarP(&SetGateway, "gateway", "G", "", "Set the node's network device gateway") baseCmd.PersistentFlags().StringVarP(&SetType, "type", "T", "", "Set the node's network device type") diff --git a/internal/pkg/container/syncuids.go b/internal/pkg/container/syncuids.go index 6066e1ca..779324db 100644 --- a/internal/pkg/container/syncuids.go +++ b/internal/pkg/container/syncuids.go @@ -100,7 +100,8 @@ func SyncUids(containerName string, showOnly bool) error { */ } - if !showOnly { + if showOnly { + wwlog.Printf(wwlog.INFO, "uid./gid not synced, run \nwwctl container syncuser --write %s\nto synchronize uid/gids.\n", containerName) return nil } // create list of files which need changed ownerships in order to change them later what diff --git a/internal/pkg/node/constructors.go b/internal/pkg/node/constructors.go index 6746aa08..6dd00bb1 100644 --- a/internal/pkg/node/constructors.go +++ b/internal/pkg/node/constructors.go @@ -166,10 +166,11 @@ func (config *nodeYaml) FindAllNodes() ([]NodeInfo, error) { n.NetDevs[devname].Gateway.Set(netdev.Gateway) n.NetDevs[devname].Type.Set(netdev.Type) n.NetDevs[devname].OnBoot.Set(netdev.OnBoot) - n.NetDevs[devname].Default.Set(netdev.Default) - // for just one netdev, it is always the default + n.NetDevs[devname].Primary.Set(netdev.Primary) + n.NetDevs[devname].Primary.Set(netdev.Default) // backwards compatibility + // for just one netdev, it is always the primary if len(node.NetDevs) == 1 { - n.NetDevs[devname].Default.Set("true") + n.NetDevs[devname].Primary.Set("true") } n.NetDevs[devname].Tags = make(map[string]*Entry) for keyname, key := range netdev.Tags { @@ -253,7 +254,7 @@ func (config *nodeYaml) FindAllNodes() ([]NodeInfo, error) { n.NetDevs[devname].Gateway.SetAlt(netdev.Gateway, p) n.NetDevs[devname].Type.SetAlt(netdev.Type, p) n.NetDevs[devname].OnBoot.SetAlt(netdev.OnBoot, p) - n.NetDevs[devname].Default.SetAlt(netdev.Default, p) + n.NetDevs[devname].Primary.SetAlt(netdev.Primary, p) if len(netdev.Tags) != 0 { for keyname, key := range netdev.Tags { if _, ok := n.NetDevs[devname].Tags[keyname]; !ok { @@ -376,7 +377,8 @@ func (config *nodeYaml) FindAllProfiles() ([]NodeInfo, error) { p.NetDevs[devname].Gateway.Set(netdev.Gateway) p.NetDevs[devname].Type.Set(netdev.Type) p.NetDevs[devname].OnBoot.Set(netdev.OnBoot) - p.NetDevs[devname].Default.Set(netdev.Default) + p.NetDevs[devname].Primary.Set(netdev.Primary) + p.NetDevs[devname].Primary.Set(netdev.Default) // backwards compatibility // The following should not be set in a profile. if netdev.Ipaddr != "" { diff --git a/internal/pkg/node/datastructure.go b/internal/pkg/node/datastructure.go index d78ee910..62408a86 100644 --- a/internal/pkg/node/datastructure.go +++ b/internal/pkg/node/datastructure.go @@ -75,7 +75,8 @@ type NetDevs struct { Prefix string `yaml:"prefix,omitempty"` Netmask string `yaml:"netmask,omitempty"` Gateway string `yaml:"gateway,omitempty"` - Default string `yaml:"primary,omitempty"` + Primary string `yaml:"primary,omitempty"` + Default string `yaml:"default,omitempty"` /* backward compatibility */ Tags map[string]string `yaml:"tags,omitempty"` } @@ -149,7 +150,7 @@ type NetDevEntry struct { Prefix Entry Netmask Entry Gateway Entry - Default Entry + Primary Entry Tags map[string]*Entry } diff --git a/internal/pkg/node/modifiers.go b/internal/pkg/node/modifiers.go index 962d8706..5cccd193 100644 --- a/internal/pkg/node/modifiers.go +++ b/internal/pkg/node/modifiers.go @@ -101,7 +101,7 @@ func (config *nodeYaml) NodeUpdate(node NodeInfo) error { config.Nodes[nodeID].NetDevs[devname].Gateway = netdev.Gateway.GetReal() config.Nodes[nodeID].NetDevs[devname].Type = netdev.Type.GetReal() config.Nodes[nodeID].NetDevs[devname].OnBoot = netdev.OnBoot.GetReal() - config.Nodes[nodeID].NetDevs[devname].Default = netdev.Default.GetReal() + config.Nodes[nodeID].NetDevs[devname].Primary = netdev.Primary.GetReal() config.Nodes[nodeID].NetDevs[devname].Tags = make(map[string]string) for keyname, key := range netdev.Tags { if key.GetReal() != "" { @@ -207,7 +207,7 @@ func (config *nodeYaml) ProfileUpdate(profile NodeInfo) error { config.NodeProfiles[profileID].NetDevs[devname].Gateway = netdev.Gateway.GetReal() config.NodeProfiles[profileID].NetDevs[devname].Type = netdev.Type.GetReal() config.NodeProfiles[profileID].NetDevs[devname].OnBoot = netdev.OnBoot.GetReal() - config.NodeProfiles[profileID].NetDevs[devname].Default = netdev.Default.GetReal() + config.NodeProfiles[profileID].NetDevs[devname].Primary = netdev.Primary.GetReal() config.NodeProfiles[profileID].NetDevs[devname].Tags = make(map[string]string) for key := range netdev.Tags { config.NodeProfiles[profileID].NetDevs[devname].Tags[key] = netdev.Tags[key].GetReal() diff --git a/internal/pkg/overlay/overlay.go b/internal/pkg/overlay/overlay.go index 8c542fe9..b7035a11 100644 --- a/internal/pkg/overlay/overlay.go +++ b/internal/pkg/overlay/overlay.go @@ -254,7 +254,7 @@ func BuildOverlayIndir(nodeInfo node.NodeInfo, overlayNames []string, outputDir tstruct.NetDevs[devname].Gateway = netdev.Gateway.Get() tstruct.NetDevs[devname].Type = netdev.Type.Get() tstruct.NetDevs[devname].OnBoot = netdev.OnBoot.Get() - tstruct.NetDevs[devname].Default = netdev.Default.Get() + tstruct.NetDevs[devname].Primary = netdev.Primary.Get() mask := net.IPMask(net.ParseIP(netdev.Netmask.Get()).To4()) ipaddr := net.ParseIP(netdev.Ipaddr.Get()).To4() netaddr := net.IPNet{IP: ipaddr, Mask: mask} diff --git a/internal/pkg/util/util.go b/internal/pkg/util/util.go index e1841863..4148bf1b 100644 --- a/internal/pkg/util/util.go +++ b/internal/pkg/util/util.go @@ -74,6 +74,33 @@ func RandomString(n int) string { return string(b) } +/* +Checks if given string is in slice. I yes returns true, false otherwise. +*/ +func InSlice(slice []string, match string) bool { + for _, val := range slice { + if val == match { + return true + } + } + return false +} + +/* +Checks if one or more elements of a slice A are a part of slice B. Returns true +as soon as one element matches.\ +*/ +func SliceInSlice(A []string, B []string) bool { + for _, a := range A { + for _, b := range B { + if a == b { + return true + } + } + } + return false +} + func IsDir(path string) bool { wwlog.Debug("Checking if path exists as a directory: %s", path) diff --git a/overlays/host/etc/dhcp/dhcpd.conf.ww b/overlays/host/etc/dhcp/dhcpd.conf.ww index 8fe8c138..6e7b6bda 100644 --- a/overlays/host/etc/dhcp/dhcpd.conf.ww +++ b/overlays/host/etc/dhcp/dhcpd.conf.ww @@ -71,7 +71,7 @@ host {{$nodes.Id.Get}}-{{if $netdevs.Device.Defined}}{{$netdevs.Device.Get}}{{el {{- if $netdevs.Ipaddr.Defined}} fixed-address {{$netdevs.Ipaddr.Get}}; {{- end}} - {{- if $netdevs.Default.GetB}} + {{- if $netdevs.Primary.GetB}} option host-name "{{$nodes.Id.Get}}"; {{else}} option host-name "{{$nodes.Id.Get}}-{{if $netdevs.Device.Defined}}{{$netdevs.Device.Get}}{{else}}{{$netname}}{{end}}"; diff --git a/overlays/host/etc/hosts.ww b/overlays/host/etc/hosts.ww index 7ef3c0cd..db0d9577 100644 --- a/overlays/host/etc/hosts.ww +++ b/overlays/host/etc/hosts.ww @@ -10,11 +10,10 @@ # Entry for {{$node.Id.Get}} {{- range $devname, $netdev := $node.NetDevs}} {{/* for each network device on the node */}} {{- if $netdev.Ipaddr.Defined}} {{/* if we have an ip address on this network device */}} -{{- /* emit the node name as hostname if this is the default */}} -{{$netdev.Ipaddr.Get}} -{{- if $netdev.Default.GetB}} {{$node.Id.Get}} -{{else}} {{$node.Id.Get}}-{{if $netdev.Device.Defined}}{{$netdev.Device.Get}}{{else}}{{$devname}}{{end}} -{{- end}} +{{- /* emit the node name as hostname if this is the primary */}} +{{$netdev.Ipaddr.Get}} {{$node.Id.Get}}-{{$devname}} +{{- if $netdev.Device.Defined}} {{$node.Id.Get}}-{{$netdev.Device.Get}}{{end}} +{{- if $netdev.Primary.GetB}} {{$node.Id.Get}}{{end}} {{- end}} {{/* end if ip */}} {{- end}} {{/* end for each network device */}} {{- end}} {{/* end for each node */}} diff --git a/overlays/wwinit/etc/systemd/network/10-persistent-net.link.ww b/overlays/wwinit/etc/systemd/network/10-persistent-net.link.ww index d335d0bc..4bfcd3fa 100644 --- a/overlays/wwinit/etc/systemd/network/10-persistent-net.link.ww +++ b/overlays/wwinit/etc/systemd/network/10-persistent-net.link.ww @@ -1,6 +1,6 @@ # /etc/systemd/network/10-persistent-net.link {{range $devname, $netdev := .NetDevs}} -{{- if $netdev.Default}} +{{- if $netdev.Primary}} [Match] MACAddress={{$netdev.Hwaddr}} [Link]