Merge pull request #1017 from brianphan/fix-10-persistent-net-link

Update 10-persistent-net.link.ww
This commit is contained in:
Christian Goll
2023-12-22 11:00:24 +01:00
committed by GitHub
4 changed files with 8 additions and 11 deletions

View File

@@ -53,6 +53,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed bug where tags from profiles weren't rendered #967
- Fixed a bug when using `wwctl container import --force` to replace an existing container
will generate an error #474
- Create `/etc/systemd/network/10-persistent-net-<netdev>.link` file per network device
### Changed

View File

@@ -30,7 +30,6 @@ defaultnode:
- default
network devices:
dummy:
device: eth0
type: ethernet
netmask: 255.255.255.0
.EE

View File

@@ -35,7 +35,6 @@ defaultnode:
- default
network devices:
dummy:
device: eth0
type: ethernet
netmask: 255.255.255.0
onboot: true`

View File

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