diff --git a/generators/dump.go b/generators/dump.go index a03aecb..43c0deb 100644 --- a/generators/dump.go +++ b/generators/dump.go @@ -15,7 +15,16 @@ type DumpGenerator struct{} // RunLXC dumps content to a file. func (g DumpGenerator) RunLXC(cacheDir, sourceDir string, img *image.LXCImage, defFile shared.DefinitionFile) error { - return g.Run(cacheDir, sourceDir, defFile) + err := g.Run(cacheDir, sourceDir, defFile) + if err != nil { + return err + } + + if defFile.Templated { + return img.AddTemplate(defFile.Path) + } + + return nil } // RunLXD dumps content to a file. diff --git a/shared/definition.go b/shared/definition.go index a6073ce..2333d02 100644 --- a/shared/definition.go +++ b/shared/definition.go @@ -96,6 +96,7 @@ type DefinitionFile struct { Releases []string `yaml:"releases,omitempty"` Name string `yaml:"name,omitempty"` Template DefinitionFileTemplate `yaml:"template,omitempty"` + Templated bool `yaml:"templated,omitempty"` } // A DefinitionFileTemplate represents the settings used by generators