mirror of
https://github.com/GoodOlClint/PSProxmoxVE.git
synced 2026-08-07 21:13:12 +00:00
a424dd18ac
Restructures the integration test workflow from a monolithic sequential job into separate provision → test → cleanup stages: - provision: creates ALL nested PVE VMs in a single terraform apply (parallel), waits for APIs, creates tokens, passes outputs to tests - test: matrix [pve9, pve8] consumes provision outputs, no provisioning - cleanup: always runs, API-only teardown for all VMs Terraform refactored to for_each with pve_instances map variable, enabling parallel ISO upload and VM creation. New caching scripts reduce redundant downloads: - ensure-base-iso.sh: downloads PVE ISOs to /opt/pve-isos if missing - ensure-cloud-images.sh: caches cloud image + OVA with 7-day TTL - prepare-auto-iso.sh: --cache-dir flag with hash-based skip Runner no longer needs manual ISO provisioning (zero-touch setup). cleanup-images bumped to min-versions-to-keep: 3 to survive overlapping runs. All jobs gated against dependabot. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
84 lines
1.4 KiB
Terraform
84 lines
1.4 KiB
Terraform
terraform {
|
|
required_version = ">= 1.5.0"
|
|
required_providers {
|
|
proxmox = {
|
|
source = "bpg/proxmox"
|
|
version = ">= 0.70.0"
|
|
}
|
|
}
|
|
}
|
|
|
|
provider "proxmox" {
|
|
endpoint = var.proxmox_endpoint
|
|
api_token = var.proxmox_api_token
|
|
insecure = var.proxmox_insecure
|
|
}
|
|
|
|
resource "proxmox_virtual_environment_file" "auto_iso" {
|
|
for_each = var.pve_instances
|
|
content_type = "iso"
|
|
datastore_id = var.iso_storage
|
|
node_name = var.target_node
|
|
|
|
source_file {
|
|
path = each.value.iso_local_path
|
|
}
|
|
}
|
|
|
|
resource "proxmox_virtual_environment_vm" "nested_pve" {
|
|
for_each = var.pve_instances
|
|
name = each.value.vm_name
|
|
node_name = var.target_node
|
|
vm_id = each.value.vm_id
|
|
|
|
machine = "q35"
|
|
bios = "ovmf"
|
|
boot_order = ["scsi0", "ide2"]
|
|
|
|
cpu {
|
|
type = "host"
|
|
cores = var.cores
|
|
sockets = 1
|
|
}
|
|
|
|
memory {
|
|
dedicated = var.memory
|
|
}
|
|
|
|
efi_disk {
|
|
datastore_id = var.disk_storage
|
|
type = "4m"
|
|
}
|
|
|
|
disk {
|
|
datastore_id = var.disk_storage
|
|
interface = "scsi0"
|
|
size = var.disk_size
|
|
file_format = "raw"
|
|
}
|
|
|
|
cdrom {
|
|
file_id = proxmox_virtual_environment_file.auto_iso[each.key].id
|
|
interface = "ide2"
|
|
}
|
|
|
|
network_device {
|
|
bridge = var.network_bridge
|
|
model = "virtio"
|
|
}
|
|
|
|
operating_system {
|
|
type = "l26"
|
|
}
|
|
|
|
agent {
|
|
enabled = true
|
|
}
|
|
|
|
started = true
|
|
|
|
lifecycle {
|
|
ignore_changes = [started, cdrom]
|
|
}
|
|
}
|