diff --git a/post-processor/atlas/post-processor.go b/post-processor/atlas/post-processor.go index 2d3e4e39f..edfc1d7c4 100644 --- a/post-processor/atlas/post-processor.go +++ b/post-processor/atlas/post-processor.go @@ -53,7 +53,8 @@ type PostProcessor struct { func (p *PostProcessor) Configure(raws ...interface{}) error { err := config.Decode(&p.config, &config.DecodeOpts{ - Interpolate: true, + Interpolate: true, + InterpolateContext: &p.config.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{}, }, diff --git a/post-processor/compress/post-processor.go b/post-processor/compress/post-processor.go index 1a4b97595..8b70bc456 100644 --- a/post-processor/compress/post-processor.go +++ b/post-processor/compress/post-processor.go @@ -31,7 +31,7 @@ type Config struct { Archive string Algorithm string - ctx *interpolate.Context + ctx interpolate.Context } type PostProcessor struct { @@ -52,7 +52,8 @@ var ( func (p *PostProcessor) Configure(raws ...interface{}) error { err := config.Decode(&p.config, &config.DecodeOpts{ - Interpolate: true, + Interpolate: true, + InterpolateContext: &p.config.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{}, }, @@ -69,7 +70,7 @@ func (p *PostProcessor) Configure(raws ...interface{}) error { p.config.OutputPath = "packer_{{.BuildName}}_{{.Provider}}" } - if err = interpolate.Validate(p.config.OutputPath, p.config.ctx); err != nil { + if err = interpolate.Validate(p.config.OutputPath, &p.config.ctx); err != nil { errs = packer.MultiErrorAppend( errs, fmt.Errorf("Error parsing target template: %s", err)) } @@ -94,7 +95,7 @@ func (p *PostProcessor) Configure(raws ...interface{}) error { errs, fmt.Errorf("%s must be set", key)) } - *ptr, err = interpolate.Render(p.config.OutputPath, p.config.ctx) + *ptr, err = interpolate.Render(p.config.OutputPath, &p.config.ctx) if err != nil { errs = packer.MultiErrorAppend( errs, fmt.Errorf("Error processing %s: %s", key, err)) diff --git a/post-processor/docker-import/post-processor.go b/post-processor/docker-import/post-processor.go index cb0e4ec7a..f9a9a18a9 100644 --- a/post-processor/docker-import/post-processor.go +++ b/post-processor/docker-import/post-processor.go @@ -27,7 +27,8 @@ type PostProcessor struct { func (p *PostProcessor) Configure(raws ...interface{}) error { err := config.Decode(&p.config, &config.DecodeOpts{ - Interpolate: true, + Interpolate: true, + InterpolateContext: &p.config.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{}, }, diff --git a/post-processor/docker-push/post-processor.go b/post-processor/docker-push/post-processor.go index 7fd2e4a32..d56f91382 100644 --- a/post-processor/docker-push/post-processor.go +++ b/post-processor/docker-push/post-processor.go @@ -33,7 +33,8 @@ type PostProcessor struct { func (p *PostProcessor) Configure(raws ...interface{}) error { err := config.Decode(&p.config, &config.DecodeOpts{ - Interpolate: true, + Interpolate: true, + InterpolateContext: &p.config.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{}, }, diff --git a/post-processor/docker-save/post-processor.go b/post-processor/docker-save/post-processor.go index ab6170802..2e3b36b4e 100644 --- a/post-processor/docker-save/post-processor.go +++ b/post-processor/docker-save/post-processor.go @@ -31,7 +31,8 @@ type PostProcessor struct { func (p *PostProcessor) Configure(raws ...interface{}) error { err := config.Decode(&p.config, &config.DecodeOpts{ - Interpolate: true, + Interpolate: true, + InterpolateContext: &p.config.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{}, }, diff --git a/post-processor/docker-tag/post-processor.go b/post-processor/docker-tag/post-processor.go index a531f2820..2f52e965d 100644 --- a/post-processor/docker-tag/post-processor.go +++ b/post-processor/docker-tag/post-processor.go @@ -31,7 +31,8 @@ type PostProcessor struct { func (p *PostProcessor) Configure(raws ...interface{}) error { err := config.Decode(&p.config, &config.DecodeOpts{ - Interpolate: true, + Interpolate: true, + InterpolateContext: &p.config.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{}, }, diff --git a/post-processor/vagrant-cloud/post-processor.go b/post-processor/vagrant-cloud/post-processor.go index ace2a5c71..53d75dac1 100644 --- a/post-processor/vagrant-cloud/post-processor.go +++ b/post-processor/vagrant-cloud/post-processor.go @@ -47,7 +47,8 @@ type PostProcessor struct { func (p *PostProcessor) Configure(raws ...interface{}) error { err := config.Decode(&p.config, &config.DecodeOpts{ - Interpolate: true, + Interpolate: true, + InterpolateContext: &p.config.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{ "box_download_url", diff --git a/post-processor/vagrant/post-processor.go b/post-processor/vagrant/post-processor.go index 63200272b..bc39c27fa 100644 --- a/post-processor/vagrant/post-processor.go +++ b/post-processor/vagrant/post-processor.go @@ -170,8 +170,9 @@ func (p *PostProcessor) PostProcess(ui packer.Ui, artifact packer.Artifact) (pac func (p *PostProcessor) configureSingle(c *Config, raws ...interface{}) error { var md mapstructure.Metadata err := config.Decode(c, &config.DecodeOpts{ - Metadata: &md, - Interpolate: true, + Metadata: &md, + Interpolate: true, + InterpolateContext: &c.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{ "output", diff --git a/post-processor/vsphere/post-processor.go b/post-processor/vsphere/post-processor.go index 0b25c7b2c..f13395765 100644 --- a/post-processor/vsphere/post-processor.go +++ b/post-processor/vsphere/post-processor.go @@ -43,7 +43,8 @@ type PostProcessor struct { func (p *PostProcessor) Configure(raws ...interface{}) error { err := config.Decode(&p.config, &config.DecodeOpts{ - Interpolate: true, + Interpolate: true, + InterpolateContext: &p.config.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{}, },