Files
warewulf/overlays/host/rootfs/etc/hosts.ww
Jonathon Anderson 6cc13455f6 Move overlays to rootfs and and set ownership
Move all overlay contents to a rootfs subdirectory, which was already
supported, and set ownership to root:root.

Closes #1078

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-02-17 10:39:06 -07:00

20 lines
892 B
Plaintext

{{ IncludeBlock "/etc/hosts" "# Do not edit after this line" }}
# This block is autogenerated by warewulf
# Host: {{.BuildHost}}
# Time: {{.BuildTime}}
# Source: {{.BuildSource}}
# Warewulf Server
{{$.Ipaddr}} {{$.BuildHost}} warewulf
{{- range $node := $.AllNodes}} {{/* for each node */}}
# Entry for {{$node.Id.Get}}
{{- range $devname, $netdev := $node.NetDevs}} {{/* for each network device on the node */}}
{{- if $netdev.Ipaddr.Defined}} {{/* if we have an ip address on this network device */}}
{{- /* emit the node name as hostname if this is the primary */}}
{{$netdev.Ipaddr.Get}} {{if $netdev.Primary.GetB}}{{$node.Id.Get}}{{end}} {{$node.Id.Get}}-{{$devname}} {{if $netdev.Device.Defined}}{{$node.Id.Get}}-{{$netdev.Device.Get}}{{end}}
{{- end }}{{/* if ip */}}
{{- end }}{{/* for each network device */}}
{{- end }}{{/* for each node */}}