From 35a947e3041257ce73523583eab1e7aa178c9fbf Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 23 May 2013 22:47:59 -0700 Subject: [PATCH] builder/amazonebs: Add provisioning step --- builder/amazonebs/builder.go | 2 ++ builder/amazonebs/step_provision.go | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 builder/amazonebs/step_provision.go diff --git a/builder/amazonebs/builder.go b/builder/amazonebs/builder.go index a3d2793ed..d3fb0f122 100644 --- a/builder/amazonebs/builder.go +++ b/builder/amazonebs/builder.go @@ -72,6 +72,8 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook) packer.Artifact { steps := []Step{ &stepKeyPair{}, &stepRunSourceInstance{}, + &stepConnectSSH{}, + &stepProvision{}, &stepStopInstance{}, &stepCreateAMI{}, } diff --git a/builder/amazonebs/step_provision.go b/builder/amazonebs/step_provision.go new file mode 100644 index 000000000..87145c98f --- /dev/null +++ b/builder/amazonebs/step_provision.go @@ -0,0 +1,21 @@ +package amazonebs + +import ( + "github.com/mitchellh/packer/packer" + "log" +) + +type stepProvision struct{} + +func (*stepProvision) Run(state map[string]interface{}) StepAction { + comm := state["communicator"].(packer.Communicator) + hook := state["hook"].(packer.Hook) + ui := state["ui"].(packer.Ui) + + log.Println("Running the provision hook") + hook.Run(packer.HookProvision, ui, comm, nil) + + return StepContinue +} + +func (*stepProvision) Cleanup(map[string]interface{}) {}