From b1bd71c1331fcab6261a810317c0ba01acd9a2df Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 5 Jun 2013 20:04:55 -0700 Subject: [PATCH] builder/vmware: Create WaitForIP step --- builder/vmware/builder.go | 3 +++ builder/vmware/step_wait_for_ip.go | 27 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 builder/vmware/step_wait_for_ip.go diff --git a/builder/vmware/builder.go b/builder/vmware/builder.go index 4d4c3ac4e..3e8c7eca9 100644 --- a/builder/vmware/builder.go +++ b/builder/vmware/builder.go @@ -22,6 +22,8 @@ type config struct { HTTPDir string `mapstructure:"http_directory"` BootCommand []string `mapstructure:"boot_command"` BootWait uint `mapstructure:"boot_wait"` + SSHUser string `mapstructure:"ssh_user"` + SSHPassword string `mapstructure:"ssh_password"` } func (b *Builder) Prepare(raw interface{}) (err error) { @@ -53,6 +55,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook) packer.Artifact { &stepHTTPServer{}, &stepRun{}, &stepTypeBootCommand{}, + &stepWaitForIP{}, } // Setup the state bag diff --git a/builder/vmware/step_wait_for_ip.go b/builder/vmware/step_wait_for_ip.go new file mode 100644 index 000000000..24a4b10c5 --- /dev/null +++ b/builder/vmware/step_wait_for_ip.go @@ -0,0 +1,27 @@ +package vmware + +import ( + "github.com/mitchellh/multistep" + "github.com/mitchellh/packer/packer" +) + +// This step creates the virtual disks for the VM. +// +// Uses: +// config *config +// ui packer.Ui +// +// Produces: +// +type stepWaitForIP struct{} + +func (stepWaitForIP) Run(state map[string]interface{}) multistep.StepAction { + ui := state["ui"].(packer.Ui) + + ui.Say("Waiting for SSH to become available...") + select{} + + return multistep.ActionContinue +} + +func (stepWaitForIP) Cleanup(map[string]interface{}) {}