diff --git a/clone/builder.go b/clone/builder.go index 0084722..477d928 100644 --- a/clone/builder.go +++ b/clone/builder.go @@ -56,6 +56,11 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack Config: &b.config.RunConfig, SetOrder: false, }, + &common.StepBootCommand{ + Config: &b.config.BootConfig, + Ctx: b.config.ctx, + VMName: b.config.VMName, + }, &common.StepWaitForIp{ Config: &b.config.WaitIpConfig, }, diff --git a/clone/config.go b/clone/config.go index bcb8b79..150ed99 100644 --- a/clone/config.go +++ b/clone/config.go @@ -19,6 +19,7 @@ type Config struct { common.ConfigParamsConfig `mapstructure:",squash"` common.RunConfig `mapstructure:",squash"` + common.BootConfig `mapstructure:",squash"` common.WaitIpConfig `mapstructure:",squash"` Comm communicator.Config `mapstructure:",squash"` common.ShutdownConfig `mapstructure:",squash"` @@ -34,6 +35,11 @@ func NewConfig(raws ...interface{}) (*Config, []string, error) { err := config.Decode(c, &config.DecodeOpts{ Interpolate: true, InterpolateContext: &c.ctx, + InterpolateFilter: &interpolate.RenderFilter{ + Exclude: []string{ + "boot_command", + }, + }, }, raws...) if err != nil { return nil, nil, err diff --git a/iso/step_boot_command.go b/common/step_boot_command.go similarity index 99% rename from iso/step_boot_command.go rename to common/step_boot_command.go index 4628062..8428528 100644 --- a/iso/step_boot_command.go +++ b/common/step_boot_command.go @@ -1,4 +1,4 @@ -package iso +package common import ( "context" diff --git a/go.mod b/go.mod index 8536831..13714d5 100644 --- a/go.mod +++ b/go.mod @@ -8,4 +8,3 @@ require ( ) replace git.apache.org/thrift.git => github.com/apache/thrift v0.0.0-20180902110319-2566ecd5d999 - diff --git a/iso/builder.go b/iso/builder.go index ccd3e8e..d844db3 100644 --- a/iso/builder.go +++ b/iso/builder.go @@ -94,7 +94,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack Config: &b.config.RunConfig, SetOrder: true, }, - &StepBootCommand{ + &common.StepBootCommand{ Config: &b.config.BootConfig, Ctx: b.config.ctx, VMName: b.config.VMName, diff --git a/iso/config.go b/iso/config.go index a6ba295..80ca2ee 100644 --- a/iso/config.go +++ b/iso/config.go @@ -24,7 +24,7 @@ type Config struct { CDRomConfig `mapstructure:",squash"` FloppyConfig `mapstructure:",squash"` common.RunConfig `mapstructure:",squash"` - BootConfig `mapstructure:",squash"` + common.BootConfig `mapstructure:",squash"` common.WaitIpConfig `mapstructure:",squash"` Comm communicator.Config `mapstructure:",squash"`