46 lines
980 B
Plaintext
46 lines
980 B
Plaintext
{{- range $devname, $netdev := .NetDevs }}
|
|
{{- $filename := print "ifcfg-" $devname ".conf" }}
|
|
{{- file $filename }}
|
|
# This file is autogenerated by warewulf
|
|
|
|
{{ if eq $netdev.Type "vlan" -}}
|
|
VLAN=yes
|
|
{{- else -}}
|
|
TYPE={{ default "ethernet" $netdev.Type }}
|
|
{{- 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 -}}
|