Use Device for Link, fallback to name

If  for the provison network an arbitary name, like overlay is used not default, the Name for the network device was the network name and not the physical device.
This commit is contained in:
Christian Goll
2022-05-19 11:11:32 +02:00
parent 3c60433c9b
commit 26c6ff39bc

View File

@@ -1,9 +1,16 @@
# /etc/systemd/network/10-persistent-net.link
# This file is autogenerated by warewulf
# Host: {{.BuildHost}}
# Time: {{.BuildTime}}
# Source: {{.BuildSource}}
{{range $devname, $netdev := .NetDevs}}
{{- if $netdev.Primary}}
[Match]
MACAddress={{$netdev.Hwaddr}}
[Link]
Name={{$devname}}
{{- end}}
{{ if $netdev.Device -}}
Name={{ $netdev.Device }}
{{ else -}}
Name={{ $devname }}
{{ end -}}
{{ end -}}
{{end}}