Commit 60dba3f8 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

builder/vmware: GuestIP lookup interface

parent dfee3eb8
...@@ -55,7 +55,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook) packer.Artifact { ...@@ -55,7 +55,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook) packer.Artifact {
&stepHTTPServer{}, &stepHTTPServer{},
&stepRun{}, &stepRun{},
&stepTypeBootCommand{}, &stepTypeBootCommand{},
&stepWaitForIP{}, &stepWaitForSSH{},
} }
// Setup the state bag // Setup the state bag
......
package vmware
// Interface to help find the IP address of a running virtual machine.
type GuestIPFinder interface {
GuestIP() (string, error)
}
// DHCPLeaseGuestLookup looks up the IP address of a guest using DHCP
// lease information from the VMware network devices.
type DHCPLeaseGuestLookup struct {
// Device that the guest is connected to.
Device string
// MAC address of the guest.
MACAddress string
}
func (f *DHCPLeaseGuestLookup) GuestIP() (string, error) {
return "", nil
}
...@@ -5,7 +5,8 @@ import ( ...@@ -5,7 +5,8 @@ import (
"github.com/mitchellh/packer/packer" "github.com/mitchellh/packer/packer"
) )
// This step creates the virtual disks for the VM. // This step waits for SSH to become available and establishes an SSH
// connection.
// //
// Uses: // Uses:
// config *config // config *config
...@@ -13,15 +14,18 @@ import ( ...@@ -13,15 +14,18 @@ import (
// //
// Produces: // Produces:
// <nothing> // <nothing>
type stepWaitForIP struct{} type stepWaitForSSH struct{}
func (stepWaitForIP) Run(state map[string]interface{}) multistep.StepAction { func (stepWaitForSSH) Run(state map[string]interface{}) multistep.StepAction {
ui := state["ui"].(packer.Ui) ui := state["ui"].(packer.Ui)
ui.Say("Waiting for SSH to become available...") ui.Say("Waiting for SSH to become available...")
select {}
for {
// First we wait for the IP to become available...
}
return multistep.ActionContinue return multistep.ActionContinue
} }
func (stepWaitForIP) Cleanup(map[string]interface{}) {} func (stepWaitForSSH) Cleanup(map[string]interface{}) {}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment