From 2475d99317bbef3f4a2372ed1377c64590ad5df8 Mon Sep 17 00:00:00 2001 From: windowsrefund Date: Tue, 16 Jul 2024 19:36:05 -0400 Subject: [PATCH] fix(docs): document role privileges required by `proxmox_virtual_environment_download_file` (#1442) * document role privileges required by proxmox_virtual_environment_download_file resource * move the new section to the download_file resource doc --------- Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com> Co-authored-by: windowsrefund Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com> --- docs/index.md | 2 +- .../virtual_environment_download_file.md | 3 ++ .../virtual_environment_download_file.md.tmpl | 31 +++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 templates/resources/virtual_environment_download_file.md.tmpl diff --git a/docs/index.md b/docs/index.md index 5168a6f5..f6f26f96 100644 --- a/docs/index.md +++ b/docs/index.md @@ -288,7 +288,7 @@ You can create an API Token for a user via the Proxmox UI, or via the command li sudo pveum user add terraform@pve ``` -- Create a role for the user (you can skip this step if you want to use the any of the existing roles): +- Create a role for the user (you can skip this step if you want to use any of the existing roles): ```sh sudo pveum role add Terraform -privs "Datastore.Allocate Datastore.AllocateSpace Datastore.AllocateTemplate Datastore.Audit Pool.Allocate Sys.Audit Sys.Console Sys.Modify SDN.Use VM.Allocate VM.Audit VM.Clone VM.Config.CDROM VM.Config.Cloudinit VM.Config.CPU VM.Config.Disk VM.Config.HWType VM.Config.Memory VM.Config.Network VM.Config.Options VM.Migrate VM.Monitor VM.PowerMgmt User.Modify" diff --git a/docs/resources/virtual_environment_download_file.md b/docs/resources/virtual_environment_download_file.md index 61de4cec..e95f1ca6 100644 --- a/docs/resources/virtual_environment_download_file.md +++ b/docs/resources/virtual_environment_download_file.md @@ -11,6 +11,9 @@ description: |- Manages files upload using PVE download-url API. It can be fully compatible and faster replacement for image files created using `proxmox_virtual_environment_file`. Supports images for VMs (ISO images) and LXC (CT Templates). +~> Besides the `Datastore.AllocateTemplate` privilege, this resource requires both the `Sys.Audit` and `Sys.Modify` privileges.

+For more details, see the [`download-url`](https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/storage/{storage}/download-url) API documentation under the "Required permissions" section. + ## Example Usage ```terraform diff --git a/templates/resources/virtual_environment_download_file.md.tmpl b/templates/resources/virtual_environment_download_file.md.tmpl new file mode 100644 index 00000000..59a829d9 --- /dev/null +++ b/templates/resources/virtual_environment_download_file.md.tmpl @@ -0,0 +1,31 @@ +--- +layout: page +title: {{.Name}} +parent: Resources +subcategory: Virtual Environment +description: |- +{{ .Description | plainmarkdown | trimspace | prefixlines " " }} +--- + +# {{.Type}}: {{.Name}} + +{{ .Description | trimspace }} + +~> Besides the `Datastore.AllocateTemplate` privilege, this resource requires both the `Sys.Audit` and `Sys.Modify` privileges.

+For more details, see the [`download-url`](https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/storage/{storage}/download-url) API documentation under the "Required permissions" section. + +{{ if .HasExample -}} +## Example Usage + +{{ codefile "terraform" .ExampleFile }} +{{- end }} + +{{ .SchemaMarkdown | trimspace }} +{{- if .HasImport }} + +## Import + +Import is supported using the following syntax: + +{{ codefile "shell" .ImportFile }} +{{- end }}