Add common steps (provision, snapshot, template) to iso builder

This commit is contained in:
Andrei Tonkikh 2018-01-30 19:47:38 +03:00
parent 50625ddcad
commit 76a09d206e
1 changed files with 24 additions and 0 deletions

View File

@ -47,6 +47,30 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
},
)
if b.config.Comm.Type != "none" {
steps = append(steps,
&common.StepRun{},
&communicator.StepConnect{
Config: &b.config.Comm,
Host: common.CommHost,
SSHConfig: common.SshConfig,
},
&packerCommon.StepProvision{},
&common.StepShutdown{
Config: &b.config.ShutdownConfig,
},
)
}
steps = append(steps,
&common.StepCreateSnapshot{
CreateSnapshot: b.config.CreateSnapshot,
},
&common.StepConvertToTemplate{
ConvertToTemplate: b.config.ConvertToTemplate,
},
)
// Run!
b.runner = packerCommon.NewRunner(steps, b.config.PackerConfig, ui)
b.runner.Run(state)