Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
60dba3f8
Commit
60dba3f8
authored
Jun 05, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/vmware: GuestIP lookup interface
parent
dfee3eb8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
1 deletion
+52
-1
builder/vmware/builder.go
builder/vmware/builder.go
+1
-1
builder/vmware/guest_ip.go
builder/vmware/guest_ip.go
+20
-0
builder/vmware/step_wait_for_ssh.go
builder/vmware/step_wait_for_ssh.go
+31
-0
No files found.
builder/vmware/builder.go
View file @
60dba3f8
...
...
@@ -55,7 +55,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook) packer.Artifact {
&
stepHTTPServer
{},
&
stepRun
{},
&
stepTypeBootCommand
{},
&
stepWaitFor
IP
{},
&
stepWaitFor
SSH
{},
}
// Setup the state bag
...
...
builder/vmware/guest_ip.go
0 → 100644
View file @
60dba3f8
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
}
builder/vmware/step_wait_for_
ip
.go
→
builder/vmware/step_wait_for_
ssh
.go
View file @
60dba3f8
...
...
@@ -5,7 +5,8 @@ import (
"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:
// config *config
...
...
@@ -13,15 +14,18 @@ import (
//
// Produces:
// <nothing>
type
stepWaitFor
IP
struct
{}
type
stepWaitFor
SSH
struct
{}
func
(
stepWaitFor
IP
)
Run
(
state
map
[
string
]
interface
{})
multistep
.
StepAction
{
func
(
stepWaitFor
SSH
)
Run
(
state
map
[
string
]
interface
{})
multistep
.
StepAction
{
ui
:=
state
[
"ui"
]
.
(
packer
.
Ui
)
ui
.
Say
(
"Waiting for SSH to become available..."
)
select
{}
for
{
// First we wait for the IP to become available...
}
return
multistep
.
ActionContinue
}
func
(
stepWaitFor
IP
)
Cleanup
(
map
[
string
]
interface
{})
{}
func
(
stepWaitFor
SSH
)
Cleanup
(
map
[
string
]
interface
{})
{}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment