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
f2186fa6
Commit
f2186fa6
authored
Apr 28, 2014
by
Ross Smith II
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #995 from asatara/add-ssh-host-vmware
Added ssh_host variable to vmware iso builder
parents
d5981c69
1783827c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
0 deletions
+17
-0
builder/vmware/common/ssh.go
builder/vmware/common/ssh.go
+4
-0
builder/vmware/common/ssh_config.go
builder/vmware/common/ssh_config.go
+10
-0
website/source/docs/builders/vmware-iso.html.markdown
website/source/docs/builders/vmware-iso.html.markdown
+3
-0
No files found.
builder/vmware/common/ssh.go
View file @
f2186fa6
...
...
@@ -17,6 +17,10 @@ func SSHAddressFunc(config *SSHConfig) func(multistep.StateBag) (string, error)
driver
:=
state
.
Get
(
"driver"
)
.
(
Driver
)
vmxPath
:=
state
.
Get
(
"vmx_path"
)
.
(
string
)
if
config
.
SSHHost
!=
""
{
return
fmt
.
Sprintf
(
"%s:%d"
,
config
.
SSHHost
,
config
.
SSHPort
),
nil
}
log
.
Println
(
"Lookup up IP information..."
)
f
,
err
:=
os
.
Open
(
vmxPath
)
if
err
!=
nil
{
...
...
builder/vmware/common/ssh_config.go
View file @
f2186fa6
...
...
@@ -3,6 +3,7 @@ package common
import
(
"errors"
"fmt"
"net"
"os"
"time"
...
...
@@ -13,6 +14,7 @@ type SSHConfig struct {
SSHUser
string
`mapstructure:"ssh_username"`
SSHKeyPath
string
`mapstructure:"ssh_key_path"`
SSHPassword
string
`mapstructure:"ssh_password"`
SSHHost
string
`mapstructure:"ssh_host"`
SSHPort
uint
`mapstructure:"ssh_port"`
SSHSkipRequestPty
bool
`mapstructure:"ssh_skip_request_pty"`
RawSSHWaitTimeout
string
`mapstructure:"ssh_wait_timeout"`
...
...
@@ -53,6 +55,14 @@ func (c *SSHConfig) Prepare(t *packer.ConfigTemplate) []error {
}
}
if
c
.
SSHHost
!=
""
{
if
ip
:=
net
.
ParseIP
(
c
.
SSHHost
);
ip
==
nil
{
if
_
,
err
:=
net
.
LookupHost
(
c
.
SSHHost
);
err
!=
nil
{
errs
=
append
(
errs
,
errors
.
New
(
"ssh_host is an invalid IP or hostname"
))
}
}
}
if
c
.
SSHUser
==
""
{
errs
=
append
(
errs
,
errors
.
New
(
"An ssh_username must be specified."
))
}
...
...
website/source/docs/builders/vmware-iso.html.markdown
View file @
f2186fa6
...
...
@@ -185,6 +185,9 @@ Optional:
The associated public key is expected to already be configured on the
VM being prepared by some other process (kickstart, etc.).
*
`ssh_host`
(string) - Hostname or IP address of the host. By default, DHCP
is used to connect to the host and this field is not used.
*
`ssh_password`
(string) - The password for
`ssh_username`
to use to
authenticate with SSH. By default this is the empty string.
...
...
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