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:
18
proxmox.tf
18
proxmox.tf
@ -6,14 +6,28 @@ provider "proxmox" {
|
|||||||
username = "terraform"
|
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" {
|
resource "proxmox_virtual_environment_download_file" "Fedora-iso" {
|
||||||
content_type = "import"
|
content_type = "import"
|
||||||
datastore_id = "local"
|
datastore_id = "local"
|
||||||
file_name = "debian-12-generic-amd64-20231228-1609.qcow2"
|
file_name = "debian-12-generic-amd64-20231228-1609.qcow2"
|
||||||
node_name = "fenix"
|
node_name = "fenix"
|
||||||
url = "https://cloud.debian.org/images/cloud/bookworm/20231228-1609/debian-12-generic-amd64-20231228-1609.qcow2"
|
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" {
|
resource "proxmox_virtual_environment_vm" "proxmox-kubernetes-VM-template" {
|
||||||
|
|||||||
Reference in New Issue
Block a user