Add ability to configure host file on the controller node

This commit is contained in:
Gregory Kurtzer
2020-12-19 00:39:19 -08:00
parent 5c354af31d
commit 7af8b03cf7
3 changed files with 108 additions and 0 deletions

14
etc/hosts.tmpl Normal file
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.Id.Get}}
{{- range $devname, $netdev := $node.NetDevs}}
{{- if $netdev.Default}}
{{$netdev.Ipaddr.Get}} {{$node.Id.Get}}
{{- else}}
{{$netdev.Ipaddr.Get}} {{$node.Id.Get}}-{{$devname}}
{{- end}}
{{- end}}
{{end}}