Commit 1055f470 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

builder/googlecompute: enable SSH

parent a72d31fb
...@@ -4,6 +4,7 @@ package googlecompute ...@@ -4,6 +4,7 @@ package googlecompute
import ( import (
"log" "log"
"time"
"github.com/mitchellh/multistep" "github.com/mitchellh/multistep"
"github.com/mitchellh/packer/common" "github.com/mitchellh/packer/common"
...@@ -51,13 +52,13 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe ...@@ -51,13 +52,13 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
new(StepCreateSSHKey), new(StepCreateSSHKey),
new(StepCreateInstance), new(StepCreateInstance),
new(StepInstanceInfo), new(StepInstanceInfo),
}
/*
&common.StepConnectSSH{ &common.StepConnectSSH{
SSHAddress: sshAddress, SSHAddress: sshAddress,
SSHConfig: sshConfig, SSHConfig: sshConfig,
SSHWaitTimeout: 5 * time.Minute, SSHWaitTimeout: 5 * time.Minute,
}, },
}
/*
new(common.StepProvision), new(common.StepProvision),
new(stepUpdateGsutil), new(stepUpdateGsutil),
new(stepCreateImage), new(stepCreateImage),
......
...@@ -24,9 +24,11 @@ func sshConfig(state multistep.StateBag) (*gossh.ClientConfig, error) { ...@@ -24,9 +24,11 @@ func sshConfig(state multistep.StateBag) (*gossh.ClientConfig, error) {
if err := keyring.AddPEMKey(privateKey); err != nil { if err := keyring.AddPEMKey(privateKey); err != nil {
return nil, fmt.Errorf("Error setting up SSH config: %s", err) return nil, fmt.Errorf("Error setting up SSH config: %s", err)
} }
sshConfig := &gossh.ClientConfig{ sshConfig := &gossh.ClientConfig{
User: config.SSHUsername, User: config.SSHUsername,
Auth: []gossh.ClientAuth{gossh.ClientAuthKeyring(keyring)}, Auth: []gossh.ClientAuth{gossh.ClientAuthKeyring(keyring)},
} }
return sshConfig, nil return sshConfig, nil
} }
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