Beispiel #1
0
func checkUnitContentFile(coreos *coreos.CoreOS, path string) {
	if path != "" {
		for _, unit := range coreos.Units() {
			if dir.HasFile(path, unit.Name()) {
				content := file.Load(path + unit.Name())
				unit.SetContent(string(content))
			}
		}
	}
}
Beispiel #2
0
func (generate *GenerateCommand) run() {
	input := file.Load(generate.input)
	initData := setup.Apply(input)

	header := header.New()

	for _, node := range initData.Cluster.Nodes {
		coreos := coreos.ConfigureCoreOS(node, initData.Cluster)
		checkUnitContentFile(&coreos, generate.units)
		//templates.ExecuteTemplate(templates.ScopeTemplateContent(), coreos)

		templates.ExecuteTemplate(templates.Header(), header)
		templates.ExecuteTemplate(templates.CoreOS(), coreos)
	}
}