Skip to content

Commit

Permalink
Merge pull request warewulf#1410 from anderbubble/1278-onboot
Browse files Browse the repository at this point in the history
Configure onboot for NetworkManager, debian networking, and wicked
  • Loading branch information
anderbubble authored Sep 23, 2024
2 parents b9a35ac + 216b55a commit f73832c
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 22 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fix autodetected kernel sorting issue. #1332
- Avoid panic on container import #1244
- make sure that warewulfd has the permission 0755 at creation time #674
- Fix "onboot" behavior for NetworkManager, Debian networking, and Suse wicked. #1278

## v4.5.7, 2024-09-11

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ master={{ $master }}
type=ethernet
{{ else }}
type={{ $netdev.Type }}
autoconnect=true
autoconnect={{ $netdev.OnBoot }}
{{ end -}}
{{ end -}}

Expand Down
20 changes: 11 additions & 9 deletions overlays/wwinit/rootfs/etc/network/interfaces.d/default.ww
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
{{- $host := .BuildHost }}
{{- $time := .BuildTime }}
{{- $source := .BuildSource }}
{{range $devname, $netdev := .NetDevs -}}
{{range $devname, $netdev := .ThisNode.NetDevs -}}
{{- $filename := print $devname }}
{{- file $filename }}
# This file is autogenerated by warewulf
# Host: {{ $host }}
# Time: {{ $time }}
# Source: {{ $source }}
auto {{$netdev.Device}}
allow-hotplug {{$netdev.Device}}
iface {{$netdev.Device}} inet static
address {{$netdev.Ipaddr}}
netmask {{$netdev.Netmask}}
gateway {{$netdev.Gateway}}
mtu {{$netdev.MTU}}
up ifmetric {{$netdev.Device}} 30
{{ if $netdev.OnBoot.GetB -}}
auto {{$netdev.Device.Get}}
{{ end -}}
allow-hotplug {{$netdev.Device.Get}}
iface {{$netdev.Device.Get}} inet static
address {{$netdev.Ipaddr.Get}}
netmask {{$netdev.Netmask.Get}}
gateway {{$netdev.Gateway.Get}}
mtu {{$netdev.MTU.Get}}
up ifmetric {{$netdev.Device.Get}} 30
{{- end}}
24 changes: 12 additions & 12 deletions overlays/wwinit/rootfs/etc/wicked/ifconfig/ifcfg.xml.ww
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- $host := .BuildHost }}
{{- $time := .BuildTime }}
{{- $source := .BuildSource }}
{{range $devname, $netdev := .NetDevs -}}
{{range $devname, $netdev := .ThisNode.NetDevs -}}
{{- $filename := print "ifcfg-" $devname ".xml" }}
{{- file $filename }}
<!--
Expand All @@ -11,15 +11,15 @@ Time: {{ $time }}
Source: {{ $source }}
-->
<interface origin="static generated warewulf config">
<name>{{$netdev.Device}}</name>
{{ if $netdev.Type -}}
<link-type>{{ $netdev.Type }}</link-type>
<name>{{$netdev.Device.Get}}</name>
{{ if $netdev.Type.Get -}}
<link-type>{{ $netdev.Type.Get }}</link-type>
{{ end -}}
{{ if $netdev.MTU -}}
<mtu>{{ $netdev.MTU }}</mtu>
{{ if $netdev.MTU.Get -}}
<mtu>{{ $netdev.MTU.Get }}</mtu>
{{ end -}}
<control>
<mode>boot</mode>
<mode>{{ if $netdev.OnBoot.GetB -}}boot{{ else }}manual{{end}}</mode>
</control>
<firewall/>
<link/>
Expand All @@ -29,12 +29,12 @@ Source: {{ $source }}
</ipv4>
<ipv4:static>
<address>
<local>{{$netdev.IpCIDR}}</local>
<local>{{$netdev.IpCIDR.Get}}</local>
</address>
{{ if $netdev.Gateway -}}
{{ if $netdev.Gateway.Get -}}
<route>
<nexthop>
<gateway>{{$netdev.Gateway}}</gateway>
<gateway>{{$netdev.Gateway.Get}}</gateway>
</nexthop>
</route>
{{ end -}}
Expand All @@ -44,10 +44,10 @@ Source: {{ $source }}
<privacy>prefer-public</privacy>
<accept-redirects>false</accept-redirects>
</ipv6>
{{ if $netdev.Ipaddr6 -}}
{{ if $netdev.Ipaddr6.Get -}}
<ipv6:static>
<address>
<local>{{ $netdev.Ipaddr6 }}</local>
<local>{{ $netdev.Ipaddr6.Get }}</local>
</address>
</ipv6:static>
{{ end -}}
Expand Down

0 comments on commit f73832c

Please sign in to comment.