Skip to content

Commit

Permalink
[feat] add temporary SSH key generation
Browse files Browse the repository at this point in the history
The documentation for the `proxmox-iso` plugin stated that when using
the SSH communicator a temporary keypair will be generate if no other
authorization methods are provided.  This operation did not take place
and this commit aims to fix that using the SSH Communicator's
'StepSSHKeyGen' step.
  • Loading branch information
bl1nk1n committed Nov 21, 2024
1 parent ec7ac1b commit 8bad6d4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion builder/proxmox/common/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,22 @@ func (b *Builder) Run(ctx context.Context, ui packersdk.Ui, hook packersdk.Hook,
},
&commonsteps.StepProvision{},
&commonsteps.StepCleanupTempKeys{
Comm: &b.config.Comm,
Comm: comm,
},
&stepRemoveCloudInitDrive{},
&stepConvertToTemplate{},
&stepFinalizeTemplateConfig{},
&stepSuccess{},
}
preSteps := b.preSteps
if (*comm).Type == "ssh" {
preSteps = append(preSteps,
&communicator.StepSSHKeyGen{
CommConf: comm,
SSHTemporaryKeyPair: (*comm).SSHTemporaryKeyPair,
},
)
}
for idx := range b.config.ISOs {
if b.config.ISOs[idx].ISODownloadPVE {
preSteps = append(preSteps,
Expand Down

0 comments on commit 8bad6d4

Please sign in to comment.