diff --git a/builder/googlecompute/builder.go b/builder/googlecompute/builder.go index 894c8e057..a1295e71b 100644 --- a/builder/googlecompute/builder.go +++ b/builder/googlecompute/builder.go @@ -63,7 +63,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack CommConf: &b.config.Comm, SSHTemporaryKeyPair: b.config.Comm.SSH.SSHTemporaryKeyPair, }, - multistep.If(b.config.PackerDebug, + multistep.If(b.config.PackerDebug && b.config.Comm.SSHPrivateKeyFile == "", &communicator.StepDumpSSHKey{ Path: fmt.Sprintf("gce_%s.pem", b.config.PackerBuildName), },