Update to templating for overlays
This commit is contained in:
@@ -22,7 +22,7 @@ func templateVnfsFileInclude(vnfsname string, filepath string) string {
|
||||
wwlog.Printf(wwlog.DEBUG, "Including VNFS file into template: %s: %s\n", vnfsname, filepath)
|
||||
|
||||
if vnfsname == "" {
|
||||
wwlog.Printf(wwlog.WARN, "VNFS not set for template: %s\n", filepath)
|
||||
wwlog.Printf(wwlog.WARN, "VNFS not set for template import request: %s: %s\n", vnfsname, filepath)
|
||||
return ""
|
||||
}
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
{{IncludeFromVnfs .Vnfs "/etc/group"}}
|
||||
{{IncludeFromVnfs $.Self.Vnfs "/etc/group"}}
|
||||
{{Include "/etc/group"}}
|
||||
|
||||
14
overlays/runtime/default/etc/hosts.ww
Normal file
14
overlays/runtime/default/etc/hosts.ww
Normal file
@@ -0,0 +1,14 @@
|
||||
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
|
||||
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
|
||||
|
||||
|
||||
{{range $node := $.AllNodes}}
|
||||
# Entry for {{$node.Fqdn}}
|
||||
{{- range $devname, $netdev := $node.NetDevs}}
|
||||
{{- if $netdev.Default}}
|
||||
{{$netdev.Ipaddr}} {{$node.Fqdn}}
|
||||
{{- else}}
|
||||
{{$netdev.Ipaddr}} {{$node.Fqdn}}-{{$devname}}
|
||||
{{- end}}
|
||||
{{- end}}
|
||||
{{end}}
|
||||
@@ -1,3 +1,3 @@
|
||||
root::0:0:root:/root:/bin/bash
|
||||
{{IncludeFromVnfs .Vnfs "/etc/passwd"}}
|
||||
{{IncludeFromVnfs $.Self.Vnfs "/etc/passwd"}}
|
||||
{{Include "/etc/passwd"}}
|
||||
|
||||
@@ -1 +1 @@
|
||||
{{.Fqdn}}
|
||||
{{$.Self.Fqdn}}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
DEVICE=eth0
|
||||
NAME=eth0
|
||||
IPADDR={{.Netdev.eth0.Ipaddr}}
|
||||
NETMASK={{.Netdev.eth0.Netmask}}
|
||||
GATEWAY={{.Netdev.eth0.Gateway}}
|
||||
HWADDR={{.Netdev.eth0.Hwaddr}}
|
||||
IPADDR={{$.Self.Netdev.eth0.Ipaddr}}
|
||||
NETMASK={{$.Self.Netdev.eth0.Netmask}}
|
||||
GATEWAY={{$.Self.Netdev.eth0.Gateway}}
|
||||
HWADDR={{$.Self.Netdev.eth0.Hwaddr}}
|
||||
BOOTPROTO=static
|
||||
ONBOOT=yes
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
NETWORKING=yes
|
||||
HOSTNAME={{.Fqdn}}
|
||||
HOSTNAME={{$.Self.Fqdn}}
|
||||
|
||||
Reference in New Issue
Block a user