-
Notifications
You must be signed in to change notification settings - Fork 74
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
WIP: [feat] add temporary SSH key generation #302
base: main
Are you sure you want to change the base?
Conversation
Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement Learn more about why HashiCorp requires a CLA and what the CLA includes Have you signed the CLA already but the status is still pending? Recheck it. |
I think after reading a TON more code I'm starting to understand something; but I have never written Go before, and I've only just touched Packer in the past week. So please be generous with the constructive criticism! (Cross-posting on issue). BE WARNED At this point I have not tested this code; however, it lines up with other code I have seen and should work. I just wanted to get my idea down to start getting feedback while I figure out how to set up my development environment proper and perform testing. |
Hey @bl1nk1n, Thanks for the PR! A few things come to mind:
Hope this feedback helps, let me know if something isn't clear! |
I just did this as the SSH keys should probably not be generated for other types of communicators such as
Ah! I did not see that, I'll have to go take a look! I haven't gotten to the step in my homelab IaC development to use
I was wondering about this. It felt super weird to just generate the SSH key and not add it in through CloudInit anywhere. I was using other template preparation plugin code for other hypervisors as examples and didn't see where they added it into CloudInit. So I assumed it was part of the process somehow (as I really don't know too much about Packer). Thanks for the tips! I'll try and work on this here in the following week or two. While it is Thanksgiving, there is usually a decent amount of downtime with the family. |
The documentation for proxmox-iso states that a temporary SSH key will be created if no SSH credentials are passed. This was not the case and this commit remedies that.
8bad6d4
to
f9a49bb
Compare
I moved The SSH key generation really was no problem, just like you stated. However, what I noticed was that Normally when using Packer I could just use In the current state, the user would basically specify I think this feature is possible to fully implement; however, after spending some time noodling with it, this might add unnecessary complexity and UI weirdness. Trying to inject SSH keys into auto install configurations prior to CD creation/HTTP server deployment while supporting many OSes seems like it will get very messy. This feature might need a more experienced touch. If no one else is able to look at it, I am willing to continue learning Go/Packer plugins and messing with it with guidance! |
NOTE: I still haven't set up my development environment for this plugin/go/Packer so this code is not tested. This will probably be my next priority now that I've laid a good foundation. |
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.Closes #301