2013-07-15 02:02:18 -04:00
|
|
|
package ebs
|
2013-05-24 01:47:59 -04:00
|
|
|
|
|
|
|
import (
|
2013-06-04 13:00:06 -04:00
|
|
|
"github.com/mitchellh/multistep"
|
2013-05-24 01:47:59 -04:00
|
|
|
"github.com/mitchellh/packer/packer"
|
|
|
|
"log"
|
|
|
|
)
|
|
|
|
|
|
|
|
type stepProvision struct{}
|
|
|
|
|
2013-06-04 13:00:06 -04:00
|
|
|
func (*stepProvision) Run(state map[string]interface{}) multistep.StepAction {
|
2013-05-24 01:47:59 -04:00
|
|
|
comm := state["communicator"].(packer.Communicator)
|
|
|
|
hook := state["hook"].(packer.Hook)
|
|
|
|
ui := state["ui"].(packer.Ui)
|
|
|
|
|
|
|
|
log.Println("Running the provision hook")
|
2013-06-26 20:54:57 -04:00
|
|
|
if err := hook.Run(packer.HookProvision, ui, comm, nil); err != nil {
|
|
|
|
state["error"] = err
|
|
|
|
return multistep.ActionHalt
|
|
|
|
}
|
2013-05-24 01:47:59 -04:00
|
|
|
|
2013-06-04 13:00:06 -04:00
|
|
|
return multistep.ActionContinue
|
2013-05-24 01:47:59 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
func (*stepProvision) Cleanup(map[string]interface{}) {}
|