Moving warewulfd code around and implementing new API for config.*()

This commit is contained in:
Gregory Kurtzer
2020-11-11 22:16:24 -08:00
parent 9a9672a060
commit fa2a7e26d3
18 changed files with 140 additions and 447 deletions

View File

@@ -27,12 +27,14 @@ func fileInclude(path string) string {
func Build(nodeList []assets.NodeInfo, force bool) error {
wwlog.Printf(wwlog.INFO, "Building System Overlays:\n")
config := config.New()
wwlog.SetIndent(4)
for _, node := range nodeList {
if node.SystemOverlay != "" {
OverlayDir := path.Join(config.LocalStateDir, "/overlays/system/", node.SystemOverlay)
OverlayFile := path.Join(config.LocalStateDir, "/provision/overlays/system/", node.Fqdn+".img")
OverlayDir := config.SystemOverlaySource(node.SystemOverlay)
OverlayFile := config.SystemOverlayImage(node.Fqdn)
wwlog.Printf(wwlog.VERBOSE, "Building System Overlay for: %s\n", node.Fqdn)