Files
warewulf/overlays/ifcfg/rootfs/etc/sysconfig/network-scripts/ifcfg.ww
Jonathon Anderson c209dadc1f Update network interface bonding configuration and documentation
- Closes: #1482
- Closes: #1280

This also corrects poor handling of whitespace around the "file" function
throughout the templates, given experiences with the network templates while
implementing the bond behavior. Since the file function actually does produce
output (that is parsed by Warewulf itself) it should not collaps prefix
whitespace.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-01-21 09:42:27 -07:00

47 lines
1023 B
Plaintext

{{- range $devname, $netdev := .NetDevs }}
{{ file (print "ifcfg-" $devname ".conf") }}
# This file is autogenerated by warewulf
{{- if eq $netdev.Type "vlan" }}
VLAN=yes
{{- else }}
TYPE={{ default "Ethernet" $netdev.Type }}
{{- end }}
{{- if $netdev.Tags.master }}
MASTER={{ $netdev.Tags.master }}
{{- end }}
DEVICE={{ $netdev.Device }}
NAME={{ $devname }}
{{- if $netdev.MTU }}
MTU={{ $netdev.MTU }}
{{- end }}
BOOTPROTO=static
DEVTIMEOUT=10
{{- if $netdev.Ipaddr }}
IPADDR={{ $netdev.Ipaddr }}
{{- end }}
{{- if $netdev.Netmask }}
NETMASK={{ $netdev.Netmask }}
{{- end }}
{{- if $netdev.Gateway }}
GATEWAY={{ $netdev.Gateway }}
{{- end }}
{{- if $netdev.Hwaddr }}
HWADDR={{ $netdev.Hwaddr }}
{{- end }}
{{- if $netdev.OnBoot }}
ONBOOT=true
{{- end }}
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
{{- if $netdev.Ipaddr6 }}
IPV6ADDR="{{ $netdev.Ipaddr6 }}"
{{- end }}
{{- range $tk, $tv := $netdev.Tags }}
{{- if eq (substr 0 3 $tk) "DNS" }}
{{ $tk }}={{ $tv }}
{{- end }}
{{- end }}
{{- end }}