// Configure sets up the config options to be used later
Configure sets up the config options to be used later
// Configure sets up the config options to be used later
func (p *PostProcessor) Configure(raws ...interface{}) error {
	err := config.Decode(&p.config,
		&config.DecodeOpts{
			Interpolate: true,
			InterpolateFilter: &interpolate.RenderFilter{
				Exclude: []string{
					"output",
				},
			},
		},
		raws...)
	if err != nil {
		return err
	}
	if p.config.OutputFile == "" {
		p.config.OutputFile = "out.tfvars"
	}
	required := map[string]*string{
		"template_file": &p.config.TemplateFile,
	}
	var errs *packer.MultiError
	for key, ptr := range required {
		if *ptr == "" {
			errs = packer.MultiErrorAppend(
				errs, fmt.Errorf("%s must be set", key))
		}
	}
	if errs != nil && len(errs.Errors) > 0 {
		return errs
	}
	return nil
}
func ( p * PostProcessor ) Configure ( raws ... interface { } ) error { err := config . Decode ( & p . config , & config . DecodeOpts { Interpolate : true , InterpolateFilter : & interpolate . RenderFilter { Exclude : [ ] string { " " , } , } , } , raws ... ) if err != nil { return err } if p . config . OutputFile == " " { p . config . OutputFile = " " } required := map [ string ] * string { " " : & p . config . TemplateFile , } var errs * packer . MultiError for key , ptr := range required { if * ptr == " " { errs = packer . MultiErrorAppend ( errs , fmt . Errorf ( " " , key ) ) } } if errs != nil && len ( errs . Errors ) > 0 { return errs } return nil }
Configure sets up the config options to be used later
Configure sets up the config options to be used later
// Configure // apply default, var not required