Homelab/terraform/pve3/main.tf
Tellsanguis 60e500087c fix(terraform): Downgrade provider Proxmox vers v2.9 stable
The v3.0 provider is not yet available as a stable release in the
OpenTofu/Terraform registry. Downgraded to v2.9 which is the latest
stable version.

Also fixed minor yamllint issues in flux.yml:
- Added space after comment marker
- Removed trailing blank line
2025-11-07 10:51:53 +01:00

64 lines
1.3 KiB
HCL

terraform {
required_version = ">= 1.6.0"
required_providers {
proxmox = {
source = "telmate/proxmox"
version = "~> 2.9"
}
local = {
source = "hashicorp/local"
version = "~> 2.1"
}
}
}
provider "proxmox" {
pm_api_url = var.proxmox_api_url
pm_api_token_id = var.proxmox_token_id
pm_api_token_secret = var.proxmox_token_secret
pm_tls_insecure = var.proxmox_tls_insecure
}
# etcd Witness VM on pve3
resource "proxmox_vm_qemu" "etcd_witness" {
name = "etcd-witness"
target_node = "pve3"
clone = var.ubuntu_template
cores = var.etcd_witness_config.cores
sockets = 1
memory = var.etcd_witness_config.memory
agent = 1
boot = "order=scsi0"
scsihw = "virtio-scsi-single"
onboot = true
network {
model = "virtio"
bridge = var.k3s_network_bridge
}
disks {
scsi {
scsi0 {
disk {
size = var.etcd_witness_config.disk_size
storage = var.storage_pool
iothread = true
}
}
}
}
ipconfig0 = "ip=${var.etcd_witness_config.ip},gw=${var.k3s_gateway}"
cicustom = "user=${var.snippets_storage}:snippets/cloud-init-etcd-witness.yaml"
nameserver = join(" ", var.k3s_dns)
lifecycle {
ignore_changes = [network]
}
depends_on = [local_file.etcd_witness_cloud_init]
}