Skip to content

Commit 8bad6d4

Browse files
committed
[feat] add temporary SSH key generation
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.
1 parent ec7ac1b commit 8bad6d4

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

builder/proxmox/common/builder.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,22 @@ func (b *Builder) Run(ctx context.Context, ui packersdk.Ui, hook packersdk.Hook,
6767
},
6868
&commonsteps.StepProvision{},
6969
&commonsteps.StepCleanupTempKeys{
70-
Comm: &b.config.Comm,
70+
Comm: comm,
7171
},
7272
&stepRemoveCloudInitDrive{},
7373
&stepConvertToTemplate{},
7474
&stepFinalizeTemplateConfig{},
7575
&stepSuccess{},
7676
}
7777
preSteps := b.preSteps
78+
if (*comm).Type == "ssh" {
79+
preSteps = append(preSteps,
80+
&communicator.StepSSHKeyGen{
81+
CommConf: comm,
82+
SSHTemporaryKeyPair: (*comm).SSHTemporaryKeyPair,
83+
},
84+
)
85+
}
7886
for idx := range b.config.ISOs {
7987
if b.config.ISOs[idx].ISODownloadPVE {
8088
preSteps = append(preSteps,

0 commit comments

Comments
 (0)