mirror of
https://github.com/Telmate/proxmox-api-go.git
synced 2026-04-26 07:55:50 +03:00
[GH-ISSUE #214] Improve Cloud-Init ipconfig[n] #44
Labels
No labels
good first issue
issue/confirmed
issue/critical
proposal/accepted
pull-request
type/bug
type/enhancement
type/feature
type/question
type/refactoring
type/testing
type/testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/proxmox-api-go#44
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @sebastian-de on GitHub (Nov 3, 2022).
Original GitHub issue: https://github.com/Telmate/proxmox-api-go/issues/214
While working with packer-plugin-proxmox, which also uses this project, I had a look at how ipconfig-entries for Cloud-Init are handled.
The way it works right now makes it quite clumsy to add the relevant support to Packer.
Right now a config block looks like this:
I would like to define the
ipconfiginside every network card block like this:I know that this is a breaking change, but I think this makes the configuration (and code) a lot cleaner.
I'm making a PR ready, please let me know what you think!
@mleone87 commented on GitHub (Nov 4, 2022):
Hello @sebastian-de and thanks for your work!
To be honest, I would love to stick to the API structure made by proxmox, this is only a wrapper for the api and the net[n] api object has no ipiconfig[n] in it. In fact, one can create a network without cloud init support(I know, we can always omit it the json)
In this api there is a notable -broken- exception for the disk where the sata/virtio/scsi[n] and that should be fixed too
I see no problem in making ipiconfig0-15 objects a more concise structure
@sebastian-de commented on GitHub (Nov 4, 2022):
Hey @mleone87 , thank you for your feedback!
I guess you're right in sticking to to Proxmox API as close as possible. Since ipconfig[n] and net[n] are mapped on the Proxmox side, I thought it made sense to declare them together. But thinking about it again, it makes more sense to separate Qemu and Cloud-Init options.
Since I don't think that it's worth the hassle to split the ipconfig-strings themselves, what do you think about just doing this:
This could be implemented without breaking the API (I think),but we would still get rid of the sixteen hardcoded ipconfig entries.If desired, the ipconfig strings could be split in a second step.
@mleone87 commented on GitHub (Dec 1, 2022):
We can close I guess, merged!