mirror of
https://github.com/outbackdingo/homelab-v.git
synced 2026-08-25 14:53:19 +00:00
tried to to some tidying while writing an article based on the current setup.
31 lines
556 B
Terraform
31 lines
556 B
Terraform
locals {
|
|
filename = "vm-${var.volume.vmid}-${var.volume.name}"
|
|
}
|
|
|
|
resource "restapi_object" "proxmox-volume" {
|
|
path = "/api2/json/nodes/${var.volume.node}/storage/${var.volume.storage}/content/"
|
|
|
|
id_attribute = "data"
|
|
|
|
force_new = [var.volume.size]
|
|
|
|
data = jsonencode({
|
|
vmid = var.volume.vmid
|
|
filename = local.filename
|
|
size = var.volume.size
|
|
format = var.volume.format
|
|
})
|
|
}
|
|
|
|
output "node" {
|
|
value = var.volume.node
|
|
}
|
|
|
|
output "storage" {
|
|
value = var.volume.storage
|
|
}
|
|
|
|
output "filename" {
|
|
value = local.filename
|
|
}
|