Skip to content

Commit

Permalink
Add ssh_port config
Browse files Browse the repository at this point in the history
  • Loading branch information
Cheng Sun committed Jan 2, 2015
1 parent 1539688 commit 2591ae8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
14 changes: 7 additions & 7 deletions builder/xenserver/common/common_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ type CommonConfig struct {

// SSHHostPortMin uint `mapstructure:"ssh_host_port_min"`
// SSHHostPortMax uint `mapstructure:"ssh_host_port_max"`
SSHKeyPath string `mapstructure:"ssh_key_path"`
SSHPassword string `mapstructure:"ssh_password"`
// SSHPort uint `mapstructure:"ssh_port"`
SSHKeyPath string `mapstructure:"ssh_key_path"`
SSHPassword string `mapstructure:"ssh_password"`
SSHPort uint `mapstructure:"ssh_port"`
SSHUser string `mapstructure:"ssh_username"`
RawSSHWaitTimeout string `mapstructure:"ssh_wait_timeout"`
SSHWaitTimeout time.Duration
Expand Down Expand Up @@ -96,12 +96,12 @@ func (c *CommonConfig) Prepare(t *packer.ConfigTemplate, pc *common.PackerConfig
if c.SSHHostPortMax == 0 {
c.SSHHostPortMax = 4444
}
if c.SSHPort == 0 {
c.SSHPort = 22
}
*/

if c.SSHPort == 0 {
c.SSHPort = 22
}

if c.RawSSHWaitTimeout == "" {
c.RawSSHWaitTimeout = "20m"
}
Expand Down
3 changes: 2 additions & 1 deletion builder/xenserver/common/step_start_on_himn.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,5 +131,6 @@ func HimnSSHIP(state multistep.StateBag) (string, error) {
}

func HimnSSHPort(state multistep.StateBag) (uint, error) {
return 22, nil
config := state.Get("commonconfig").(CommonConfig)
return config.SSHPort, nil
}
2 changes: 0 additions & 2 deletions docs/builders/xenserver-iso.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,8 @@ each category, the available options are alphabetized and described.
* `ssh_password` (string) - The password for `ssh_username` to use to
authenticate with SSH. By default this is the empty string.

<!--
* `ssh_port` (integer) - The port that SSH will be listening on in the guest
virtual machine. By default this is 22.
-->

* `ssh_wait_timeout` (string) - The duration to wait for SSH to become
available. By default this is "20m", or 20 minutes. Note that this should
Expand Down

0 comments on commit 2591ae8

Please sign in to comment.