debug mode: don't dump the ssh key if its from a file

This commit is contained in:
Adrien Delorme 2020-10-20 12:00:49 +02:00
parent df913f596b
commit 536421efaf
1 changed files with 1 additions and 1 deletions

View File

@ -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),
},