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 ( import (
"fmt" "fmt"
"log"
"runtime" "runtime"
"forge.cadoles.com/pcaseiro/templatefile/pkg/utils" "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 { switch os := p.Distribution; os {
case "debian", "ubuntu": case "debian", "ubuntu":
_, stdErr, pkErr = utils.RunSystemCommand("apt", "install", "-y", p.Name) _, 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 // Manage system packages
log.Printf("Installing packages:")
for _, pack := range s.Packages { for _, pack := range s.Packages {
err := pack.Manage() err := pack.Manage()
if err != nil { if err != nil {
return err 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) err = processConfigFiles(s.ConfigFiles, s.Vars, templateDir)