Files
PSProxmoxVE/tests/infrastructure/variables.tf
T
Clint Branham 80871f750b feat: consolidate infrastructure into Terraform + terraform destroy cleanup
Major provisioning pipeline changes:

Terraform:
- Add kreuzwerker/docker provider to manage iSCSI and NFS storage
  containers alongside PVE VMs in a single Terraform config
- New storage.tf with Docker container, image, and volume resources
- docker_host_ip variable for PVE nodes to reach storage services

Provisioning:
- Replace docker-compose storage management with Terraform
- Replace create-api-token.sh with wait-for-pve.sh (IP discovery +
  API readiness + auth verification only — no token creation)
- Tests use root@pam credentials, not API tokens

Cleanup:
- Replace preflight-cleanup.sh loop with terraform destroy
- Supports version filtering: cleanup 9 destroys only PVE 9 resources
- Full cleanup also removes config.json and tfvars

New commands:
- taint [8|9|all]: marks VMs for recreation on next provision
- dev.ps1 -Reprovision: runs taint before provision to force VM rebuild

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 14:16:52 -05:00

91 lines
2.3 KiB
Terraform

variable "proxmox_endpoint" {
description = "URL of the existing Proxmox VE API (e.g. https://pve.example.com:8006)"
type = string
}
variable "proxmox_api_token" {
description = "API token for authenticating with the existing Proxmox host (user@realm!tokenid=secret)"
type = string
sensitive = true
}
variable "proxmox_insecure" {
description = "Whether to skip TLS verification when connecting to the Proxmox API"
type = bool
default = true
}
variable "target_node" {
description = "Name of the Proxmox node where the nested PVE VMs will be created"
type = string
}
variable "pve_instances" {
description = "Map of PVE instances to provision. Key is a label (e.g. 'pve9'), value defines the VM."
type = map(object({
iso_local_path = string
vm_id = number
vm_name = string
}))
}
variable "cores" {
description = "Number of CPU cores to allocate to each nested PVE VM"
type = number
default = 4
}
variable "memory" {
description = "Amount of memory in MB to allocate to each nested PVE VM"
type = number
default = 8192
}
variable "disk_size" {
description = "Size of the primary disk in GB for each nested PVE VM"
type = number
default = 64
}
variable "disk_storage" {
description = "Proxmox storage pool for VM disks (must support raw format)"
type = string
default = "nas-iSCSI-lvm"
}
variable "iso_storage" {
description = "Proxmox storage pool for uploading the ISO (must accept ISO content type)"
type = string
default = "local"
}
variable "network_bridge" {
description = "Network bridge on the host to attach the nested PVE VMs to"
type = string
default = "Core"
}
variable "test_vm_password" {
description = "Root password for the nested PVE instances. Set via TF_VAR_test_vm_password env var."
type = string
sensitive = true
}
variable "storage_iscsi_iqn" {
description = "iSCSI target IQN for the test storage"
type = string
default = "iqn.2024-01.local.test:storage"
}
variable "storage_iscsi_lun_size" {
description = "Size of the iSCSI LUN backing file"
type = string
default = "10G"
}
variable "docker_host_ip" {
description = "IP of the Docker host, used by PVE nodes to reach storage containers"
type = string
}