Update to templating for overlays

This commit is contained in:
Gregory Kurtzer
2020-12-01 13:04:49 -08:00
parent 4d752a67db
commit cc55c2a196
7 changed files with 23 additions and 9 deletions

View File

@@ -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 ""
}

View File

@@ -1,2 +1,2 @@
{{IncludeFromVnfs .Vnfs "/etc/group"}}
{{IncludeFromVnfs $.Self.Vnfs "/etc/group"}}
{{Include "/etc/group"}}

View 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}}

View File

@@ -1,3 +1,3 @@
root::0:0:root:/root:/bin/bash
{{IncludeFromVnfs .Vnfs "/etc/passwd"}}
{{IncludeFromVnfs $.Self.Vnfs "/etc/passwd"}}
{{Include "/etc/passwd"}}

View File

@@ -1 +1 @@
{{.Fqdn}}
{{$.Self.Fqdn}}

View File

@@ -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

View File

@@ -1,2 +1,2 @@
NETWORKING=yes
HOSTNAME={{.Fqdn}}
HOSTNAME={{$.Self.Fqdn}}