From 1055f470e677b2fb42d30fd7382f5f970b38d706 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 13 Dec 2013 18:06:49 -0800 Subject: [PATCH] builder/googlecompute: enable SSH --- builder/googlecompute/builder.go | 5 +++-- builder/googlecompute/ssh.go | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/builder/googlecompute/builder.go b/builder/googlecompute/builder.go index 1fe154635..b385a0ceb 100644 --- a/builder/googlecompute/builder.go +++ b/builder/googlecompute/builder.go @@ -4,6 +4,7 @@ package googlecompute import ( "log" + "time" "github.com/mitchellh/multistep" "github.com/mitchellh/packer/common" @@ -51,13 +52,13 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe new(StepCreateSSHKey), new(StepCreateInstance), new(StepInstanceInfo), - } - /* &common.StepConnectSSH{ SSHAddress: sshAddress, SSHConfig: sshConfig, SSHWaitTimeout: 5 * time.Minute, }, + } + /* new(common.StepProvision), new(stepUpdateGsutil), new(stepCreateImage), diff --git a/builder/googlecompute/ssh.go b/builder/googlecompute/ssh.go index 77f226959..4254c916a 100644 --- a/builder/googlecompute/ssh.go +++ b/builder/googlecompute/ssh.go @@ -24,9 +24,11 @@ func sshConfig(state multistep.StateBag) (*gossh.ClientConfig, error) { if err := keyring.AddPEMKey(privateKey); err != nil { return nil, fmt.Errorf("Error setting up SSH config: %s", err) } + sshConfig := &gossh.ClientConfig{ User: config.SSHUsername, Auth: []gossh.ClientAuth{gossh.ClientAuthKeyring(keyring)}, } + return sshConfig, nil }