Commit 7c8e86c9 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

provisioner/*: fix interpolation context

parent 5241d8c6
...@@ -58,6 +58,7 @@ type Provisioner struct { ...@@ -58,6 +58,7 @@ type Provisioner struct {
func (p *Provisioner) Prepare(raws ...interface{}) error { func (p *Provisioner) Prepare(raws ...interface{}) error {
err := config.Decode(&p.config, &config.DecodeOpts{ err := config.Decode(&p.config, &config.DecodeOpts{
Interpolate: true, Interpolate: true,
InterpolateContext: &p.config.ctx,
InterpolateFilter: &interpolate.RenderFilter{ InterpolateFilter: &interpolate.RenderFilter{
Exclude: []string{}, Exclude: []string{},
}, },
......
...@@ -70,6 +70,7 @@ type InstallChefTemplate struct { ...@@ -70,6 +70,7 @@ type InstallChefTemplate struct {
func (p *Provisioner) Prepare(raws ...interface{}) error { func (p *Provisioner) Prepare(raws ...interface{}) error {
err := config.Decode(&p.config, &config.DecodeOpts{ err := config.Decode(&p.config, &config.DecodeOpts{
Interpolate: true, Interpolate: true,
InterpolateContext: &p.config.ctx,
InterpolateFilter: &interpolate.RenderFilter{ InterpolateFilter: &interpolate.RenderFilter{
Exclude: []string{ Exclude: []string{
"execute_command", "execute_command",
......
...@@ -74,6 +74,7 @@ type InstallChefTemplate struct { ...@@ -74,6 +74,7 @@ type InstallChefTemplate struct {
func (p *Provisioner) Prepare(raws ...interface{}) error { func (p *Provisioner) Prepare(raws ...interface{}) error {
err := config.Decode(&p.config, &config.DecodeOpts{ err := config.Decode(&p.config, &config.DecodeOpts{
Interpolate: true, Interpolate: true,
InterpolateContext: &p.config.ctx,
InterpolateFilter: &interpolate.RenderFilter{ InterpolateFilter: &interpolate.RenderFilter{
Exclude: []string{ Exclude: []string{
"execute_command", "execute_command",
......
...@@ -33,6 +33,7 @@ type Provisioner struct { ...@@ -33,6 +33,7 @@ type Provisioner struct {
func (p *Provisioner) Prepare(raws ...interface{}) error { func (p *Provisioner) Prepare(raws ...interface{}) error {
err := config.Decode(&p.config, &config.DecodeOpts{ err := config.Decode(&p.config, &config.DecodeOpts{
Interpolate: true, Interpolate: true,
InterpolateContext: &p.config.ctx,
InterpolateFilter: &interpolate.RenderFilter{ InterpolateFilter: &interpolate.RenderFilter{
Exclude: []string{}, Exclude: []string{},
}, },
......
...@@ -100,6 +100,7 @@ type ExecuteCommandTemplate struct { ...@@ -100,6 +100,7 @@ type ExecuteCommandTemplate struct {
func (p *Provisioner) Prepare(raws ...interface{}) error { func (p *Provisioner) Prepare(raws ...interface{}) error {
err := config.Decode(&p.config, &config.DecodeOpts{ err := config.Decode(&p.config, &config.DecodeOpts{
Interpolate: true, Interpolate: true,
InterpolateContext: &p.config.ctx,
InterpolateFilter: &interpolate.RenderFilter{ InterpolateFilter: &interpolate.RenderFilter{
Exclude: []string{ Exclude: []string{
"execute_command", "execute_command",
......
...@@ -67,6 +67,7 @@ type ExecuteTemplate struct { ...@@ -67,6 +67,7 @@ type ExecuteTemplate struct {
func (p *Provisioner) Prepare(raws ...interface{}) error { func (p *Provisioner) Prepare(raws ...interface{}) error {
err := config.Decode(&p.config, &config.DecodeOpts{ err := config.Decode(&p.config, &config.DecodeOpts{
Interpolate: true, Interpolate: true,
InterpolateContext: &p.config.ctx,
InterpolateFilter: &interpolate.RenderFilter{ InterpolateFilter: &interpolate.RenderFilter{
Exclude: []string{ Exclude: []string{
"execute_command", "execute_command",
......
...@@ -44,7 +44,6 @@ type Config struct { ...@@ -44,7 +44,6 @@ type Config struct {
// If true, packer will ignore all exit-codes from a puppet run // If true, packer will ignore all exit-codes from a puppet run
IgnoreExitCodes bool `mapstructure:"ignore_exit_codes"` IgnoreExitCodes bool `mapstructure:"ignore_exit_codes"`
} }
type Provisioner struct { type Provisioner struct {
...@@ -64,6 +63,7 @@ type ExecuteTemplate struct { ...@@ -64,6 +63,7 @@ type ExecuteTemplate struct {
func (p *Provisioner) Prepare(raws ...interface{}) error { func (p *Provisioner) Prepare(raws ...interface{}) error {
err := config.Decode(&p.config, &config.DecodeOpts{ err := config.Decode(&p.config, &config.DecodeOpts{
Interpolate: true, Interpolate: true,
InterpolateContext: &p.config.ctx,
InterpolateFilter: &interpolate.RenderFilter{ InterpolateFilter: &interpolate.RenderFilter{
Exclude: []string{}, Exclude: []string{},
}, },
......
...@@ -45,6 +45,7 @@ type Provisioner struct { ...@@ -45,6 +45,7 @@ type Provisioner struct {
func (p *Provisioner) Prepare(raws ...interface{}) error { func (p *Provisioner) Prepare(raws ...interface{}) error {
err := config.Decode(&p.config, &config.DecodeOpts{ err := config.Decode(&p.config, &config.DecodeOpts{
Interpolate: true, Interpolate: true,
InterpolateContext: &p.config.ctx,
InterpolateFilter: &interpolate.RenderFilter{ InterpolateFilter: &interpolate.RenderFilter{
Exclude: []string{}, Exclude: []string{},
}, },
......
...@@ -30,6 +30,7 @@ type Provisioner struct { ...@@ -30,6 +30,7 @@ type Provisioner struct {
func (p *Provisioner) Prepare(raws ...interface{}) error { func (p *Provisioner) Prepare(raws ...interface{}) error {
err := config.Decode(&p.config, &config.DecodeOpts{ err := config.Decode(&p.config, &config.DecodeOpts{
Interpolate: true, Interpolate: true,
InterpolateContext: &p.config.ctx,
InterpolateFilter: &interpolate.RenderFilter{ InterpolateFilter: &interpolate.RenderFilter{
Exclude: []string{ Exclude: []string{
"execute_command", "execute_command",
......
...@@ -74,6 +74,7 @@ type ExecuteCommandTemplate struct { ...@@ -74,6 +74,7 @@ type ExecuteCommandTemplate struct {
func (p *Provisioner) Prepare(raws ...interface{}) error { func (p *Provisioner) Prepare(raws ...interface{}) error {
err := config.Decode(&p.config, &config.DecodeOpts{ err := config.Decode(&p.config, &config.DecodeOpts{
Interpolate: true, Interpolate: true,
InterpolateContext: &p.config.ctx,
InterpolateFilter: &interpolate.RenderFilter{ InterpolateFilter: &interpolate.RenderFilter{
Exclude: []string{ Exclude: []string{
"execute_command", "execute_command",
......
...@@ -44,6 +44,7 @@ type Provisioner struct { ...@@ -44,6 +44,7 @@ type Provisioner struct {
func (p *Provisioner) Prepare(raws ...interface{}) error { func (p *Provisioner) Prepare(raws ...interface{}) error {
err := config.Decode(&p.config, &config.DecodeOpts{ err := config.Decode(&p.config, &config.DecodeOpts{
Interpolate: true, Interpolate: true,
InterpolateContext: &p.config.ctx,
InterpolateFilter: &interpolate.RenderFilter{ InterpolateFilter: &interpolate.RenderFilter{
Exclude: []string{ Exclude: []string{
"execute_command", "execute_command",
......
...@@ -77,6 +77,7 @@ type ExecuteCommandTemplate struct { ...@@ -77,6 +77,7 @@ type ExecuteCommandTemplate struct {
func (p *Provisioner) Prepare(raws ...interface{}) error { func (p *Provisioner) Prepare(raws ...interface{}) error {
err := config.Decode(&p.config, &config.DecodeOpts{ err := config.Decode(&p.config, &config.DecodeOpts{
Interpolate: true, Interpolate: true,
InterpolateContext: &p.config.ctx,
InterpolateFilter: &interpolate.RenderFilter{ InterpolateFilter: &interpolate.RenderFilter{
Exclude: []string{ Exclude: []string{
"execute_command", "execute_command",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment