Hello,
First I want to say, that I am really happy and grateful to be able and allowed to use such a great piece of software (Proxmox). I am pretty new to it, so I apologize if this is an oversight on my part.
I have decided to build a Terraform / OpenTofu based configuration script, that does some initial set up like:
Furthermore if I use the PUT endpoint to create a standard repository, it's added over and over again and instead of being added to its own
Here's a suggestion to make this piece of API useful:
Thank you for reading and I am eager to hear what other, probably much more experienced users, think about this.
First I want to say, that I am really happy and grateful to be able and allowed to use such a great piece of software (Proxmox). I am pretty new to it, so I apologize if this is an oversight on my part.
I have decided to build a Terraform / OpenTofu based configuration script, that does some initial set up like:
- Create user
- Create API token
- Import ZFS pool
- Import ZFS dataset for ISO and other images
- Install scripts
- Modify repositories
Furthermore if I use the PUT endpoint to create a standard repository, it's added over and over again and instead of being added to its own
sources.list file within /etc/apt/sources.list.d/, it's added to /etc/apt/sources.list. Since pve-enterprise.list is its own list (and IMO rightfully so) and within the directory mentioned above, I don't understand why this isn't handled the same in all cases.Here's a suggestion to make this piece of API useful:
- GET
/nodes/{node}/apt/repositories- Lists all configured repositories with their details (handle, URL, status, etc.)
- Response should include standard-repositories (with everything relevant) and possibly custom repositories
- POST
/nodes/{node}/apt/repositories- Creates a new repository configuration
- Properly creates a new file in
/etc/apt/sources.list.d/ - Requires body with repository details (URI, version, filename?)
- GET
/nodes/{node}/apt/repositories/{handle}- Returns details for specific repository
- Would look similar to e.g. the GET without the
{handle}ID, but limited to one repository only
- PUT
/nodes/{node}/apt/repositories/{handle}- Updates existing repository configuration
- Can enable/disable repository
- Updates proper file in
/etc/apt/sources.list.d/by prepending a#(just as it does now)
- DELETE
/nodes/{node}/apt/repositories/{handle}- Removes repository configuration
- Cleanly deletes corresponding file from
/etc/apt/sources.list.d/ - Could also delete just the line in that file
ssh_resource to do just that. The only downside of this workaround is, that I have to know the VERSION_CODENAME and the proper URI.Thank you for reading and I am eager to hear what other, probably much more experienced users, think about this.
Last edited: