mirror of
https://gitea.fenix-dev.com/fenix-gitea-admin/iac-opentofu-private.git
synced 2025-10-27 15:53:06 +00:00
Update proxmox.tf
This commit is contained in:
15
proxmox.tf
15
proxmox.tf
@ -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" {
|
||||
depends_on = [null_resource.download_image]
|
||||
@ -55,7 +42,7 @@ resource "proxmox_virtual_environment_vm" "proxmox-kubernetes-VM-template" {
|
||||
disk {
|
||||
datastore_id = "local-lvm"
|
||||
interface = "scsii"
|
||||
file = "./images/ubuntu-bionic.img"
|
||||
file_id = "local-lvm:iso/ubuntu-cloud.img"
|
||||
size = 20
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user