-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SSHPublicKey created too late for cd_content #182
Comments
Hi @timeu, I'd have to investigate, but if I had to guess, this doesn't look feasible as the builder's the one creating the ssh key, and the source configuration needs to be complete (i.e. interpolated) at that point, so I'm not certain we'll be able to do what you want here. As a workaround, I'd suggest using a provisioner to add this to the cloud-config file (though this implies you'll be able to connect, which I assume is the whole point of this addition), or alternatively, to provide your own SSH private/public keys that you can interpolate with a reference to a variable. Something like the following:
Hope that helps! |
@lbajolet-hashicorp : thanks for the response. |
Hi @timeu, Out of curiosity, may I ask which PR you are referring to? It is possible I missed something which would make it possible, though at first glance I would still think we have a bootstrapping problem, but I'll be happy to be proved wrong on this one! If you are willing to do a PR with an implementation please feel free to do so, and let me know when it's ready to be reviewed, I'll definitely take a look at it, thanks! |
@lbajolet-hashicorp : Sorry forgot to mention the PR. It's this one: hashicorp/packer-plugin-vmware#203 |
I tested this myself but it still didn't work when I reordered the steps, I think @lbajolet-hashicorp is correct that the interpolation happens too early for this to work I make use of the variable by adding this to the boot args before
Then use late-commands in the Ubuntu autoinstall config to install the key
|
Overview of the Issue
Similar to the issue in the vmware plugin (hashicorp/packer-plugin-vmware#177) this is also happening with the QEMU plugin. The SSHPublicKey step runs after the creation of the CD/Floppy and thus cannot be used there.
Reproduction Steps
Add to the
source
definitionPlugin and Packer version
From
packer version
packer-plugin-qemu_v1.1.0_x5.0_linux_amd64
The text was updated successfully, but these errors were encountered: