From 4aef5237dc59625a22012435d081cc5a54f1babd Mon Sep 17 00:00:00 2001 From: fenix-gitea-admin Date: Wed, 20 Aug 2025 22:00:42 +0000 Subject: [PATCH 1/3] Update proxmox.tf --- proxmox.tf | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/proxmox.tf b/proxmox.tf index 6e219fd..0ce662e 100644 --- a/proxmox.tf +++ b/proxmox.tf @@ -6,14 +6,28 @@ provider "proxmox" { username = "terraform" } } + +resource "null_resource" "download_image" { + provisioner "local-exec" { + command = < Date: Wed, 20 Aug 2025 22:01:03 +0000 Subject: [PATCH 2/3] Update proxmox.variables.tf --- proxmox.variables.tf | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/proxmox.variables.tf b/proxmox.variables.tf index e6995bd..cbce36e 100644 --- a/proxmox.variables.tf +++ b/proxmox.variables.tf @@ -8,4 +8,20 @@ variable "proxmox_apikey" { description = "Proxmox server api key" type = string sensitive = false +} + +variable "image_source_url" { + default = "https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64.img" +} + +variable "local_image_path" { + default = "./images/ubuntu-bionic.img" +} + +variable "node_name" { + default = "fenix" +} + +variable "datastore_id" { + default = "local-lvm" } \ No newline at end of file From 090602c1e175e3ecf600cd78e1e7fa95a0efd050 Mon Sep 17 00:00:00 2001 From: fenix-gitea-admin Date: Wed, 20 Aug 2025 22:03:14 +0000 Subject: [PATCH 3/3] Update proxmox.tf --- proxmox.tf | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/proxmox.tf b/proxmox.tf index 0ce662e..6c77c7f 100644 --- a/proxmox.tf +++ b/proxmox.tf @@ -21,17 +21,8 @@ resource "null_resource" "download_image" { } } - -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" -} - resource "proxmox_virtual_environment_vm" "proxmox-kubernetes-VM-template" { - depends_on = [proxmox_virtual_environment_download_file.Fedora-iso] + depends_on = [null_resource.download_image] name = "proxmox-kubernetes-VM-template" node_name = "fenix" vm_id = 1002 @@ -64,7 +55,7 @@ resource "proxmox_virtual_environment_vm" "proxmox-kubernetes-VM-template" { disk { datastore_id = "local-lvm" interface = "scsii" - file_id = proxmox_virtual_environment_download_file.Fedora-iso.id + file = "./images/ubuntu-bionic.img" size = 20 }