multifile templates for network configs
This commit is contained in:
@@ -1,9 +0,0 @@
|
||||
DEVICE={{$.NetDevs.default.Device}}
|
||||
NAME=default
|
||||
BOOTPROTO=static
|
||||
DEVTIMEOUT=10
|
||||
IPADDR={{$.NetDevs.default.Ipaddr}}
|
||||
NETMASK={{$.NetDevs.default.Netmask}}
|
||||
GATEWAY={{$.NetDevs.default.Gateway}}
|
||||
HWADDR={{$.NetDevs.default.Hwaddr}}
|
||||
ONBOOT=yes
|
||||
20
overlays/wwinit/etc/sysconfig/network-scripts/ifcfg.ww
Normal file
20
overlays/wwinit/etc/sysconfig/network-scripts/ifcfg.ww
Normal file
@@ -0,0 +1,20 @@
|
||||
{{- $host := .BuildHost }}
|
||||
{{- $time := .BuildTime }}
|
||||
{{- $source := .BuildSource }}
|
||||
{{range $devname, $netdev := .NetDevs -}}
|
||||
{{- $filename := print "ifcfg-" $devname ".conf" }}
|
||||
{{- file $filename }}
|
||||
# This file is autogenerated by warewulf
|
||||
# Host: {{ $host }}
|
||||
# Time: {{ $time }}
|
||||
# Source: {{ $source }}
|
||||
DEVICE={{ $netdev.Device }}
|
||||
NAME=default
|
||||
BOOTPROTO=static
|
||||
DEVTIMEOUT=10
|
||||
IPADDR={{ $netdev.Ipaddr }}
|
||||
NETMASK={{ $netdev.Netmask }}
|
||||
GATEWAY={{ $netdev.Gateway }}
|
||||
HWADDR={{ $netdev.Hwaddr }}
|
||||
ONBOOT=yes
|
||||
{{- end}} {{/* end for each network device */
|
||||
@@ -1,5 +1,17 @@
|
||||
{{- $host := .BuildHost }}
|
||||
{{- $time := .BuildTime }}
|
||||
{{- $source := .BuildSource }}
|
||||
{{range $devname, $netdev := .NetDevs -}}
|
||||
{{- $filename := print "ifcfg-" $devname ".xml" }}
|
||||
{{- file $filename }}
|
||||
<!--
|
||||
This file is autogenerated by warewulf
|
||||
Host: {{ $host }}
|
||||
Time: {{ $time }}
|
||||
Source: {{ $source }}
|
||||
-->
|
||||
<interface origin="static generated warewulf config">
|
||||
<name>{{.NetDevs.default.Device}}</name>
|
||||
<name>{{$netdev.Device}}</name>
|
||||
<control>
|
||||
<mode>boot</mode>
|
||||
</control>
|
||||
@@ -11,11 +23,11 @@
|
||||
</ipv4>
|
||||
<ipv4:static>
|
||||
<address>
|
||||
<local>{{$.NetDevs.default.IpCIDR}}</local>
|
||||
<local>{{$netdev.IpCIDR}}</local>
|
||||
</address>
|
||||
<route>
|
||||
<nexthop>
|
||||
<gateway>{{$.NetDevs.default.Gateway}}</gateway>
|
||||
<gateway>{{$netdev.Gateway}}</gateway>
|
||||
</nexthop>
|
||||
</route>
|
||||
</ipv4:static>
|
||||
@@ -25,3 +37,4 @@
|
||||
<accept-redirects>false</accept-redirects>
|
||||
</ipv6>
|
||||
</interface>
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user