Update proxmox.tf

This commit is contained in:
2025-08-20 22:12:10 +00:00
parent 090602c1e1
commit aa17346efb

View File

@ -7,19 +7,6 @@ provider "proxmox" {
} }
} }
resource "null_resource" "download_image" {
provisioner "local-exec" {
command = <<EOT
mkdir -p ./images
if [ ! -f ${var.local_image_path} ]; then
echo "Downloading image from ${var.image_source_url}..."
curl -L -o ${var.local_image_path} ${var.image_source_url}
else
echo "Image already exists: ${var.local_image_path}"
fi
EOT
}
}
resource "proxmox_virtual_environment_vm" "proxmox-kubernetes-VM-template" { resource "proxmox_virtual_environment_vm" "proxmox-kubernetes-VM-template" {
depends_on = [null_resource.download_image] depends_on = [null_resource.download_image]
@ -55,7 +42,7 @@ resource "proxmox_virtual_environment_vm" "proxmox-kubernetes-VM-template" {
disk { disk {
datastore_id = "local-lvm" datastore_id = "local-lvm"
interface = "scsii" interface = "scsii"
file = "./images/ubuntu-bionic.img" file_id = "local-lvm:iso/ubuntu-cloud.img"
size = 20 size = 20
} }