Update proxmox.tf

This commit is contained in:
2025-08-20 22:00:42 +00:00
parent f5bf70c63f
commit 4aef5237dc

View File

@ -6,14 +6,28 @@ provider "proxmox" {
username = "terraform"
}
}
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_download_file" "Fedora-iso" {
content_type = "import"
datastore_id = "local"
file_name = "debian-12-generic-amd64-20231228-1609.qcow2"
node_name = "fenix"
url = "https://cloud.debian.org/images/cloud/bookworm/20231228-1609/debian-12-generic-amd64-20231228-1609.qcow2"
checksum = "d2fbcf11fb28795842e91364d8c7b69f1870db09ff299eb94e4fbbfa510eb78d141e74c1f4bf6dfa0b7e33d0c3b66e6751886feadb4e9916f778bab1776bdf1b"
checksum_algorithm = "sha512"
}
resource "proxmox_virtual_environment_vm" "proxmox-kubernetes-VM-template" {