This commit is contained in:
Philippe Caseiro 2022-06-29 17:07:43 +02:00
parent 97f7d28838
commit 767c3856a1
2 changed files with 4 additions and 2 deletions

View File

@ -2,6 +2,7 @@ package templater
import (
"fmt"
"log"
"runtime"
"forge.cadoles.com/pcaseiro/templatefile/pkg/utils"
@ -45,7 +46,7 @@ func (p *SystemPackage) Manage() error {
}
}
fmt.Printf("Processing %s package\n", p.Name)
log.Printf("\t Installing %s package\n", p.Name)
switch os := p.Distribution; os {
case "debian", "ubuntu":
_, stdErr, pkErr = utils.RunSystemCommand("apt", "install", "-y", p.Name)

View File

@ -50,12 +50,13 @@ func (s *Service) Manage(templateDir string) error {
}
// Manage system packages
log.Printf("Installing packages:")
for _, pack := range s.Packages {
err := pack.Manage()
if err != nil {
return err
}
log.Printf("Package %s installed\n", pack.Name)
log.Printf("\tPackage %s installed\n", pack.Name)
}
err = processConfigFiles(s.ConfigFiles, s.Vars, templateDir)