terraform { required_providers { proxmox = { source = "bpg/proxmox" version = "0.85.1" } talos = { source = "siderolabs/talos" version = "0.9.0" } } } resource "proxmox_virtual_environment_vm" "worker" { name = var.worker.node_name node_name = "pve01" tags = ["tofu"] bios = "ovmf" on_boot = true machine = "q35" stop_on_destroy = true operating_system { type = "l26" } agent { enabled = true } cpu { cores = var.worker.cpu sockets = 1 type = "x86-64-v2-AES" } memory { dedicated = var.worker.memory * 1024 } disk { datastore_id = var.worker.storagepool interface = "virtio0" aio = "io_uring" size = var.worker.disk * 1024 file_format = "raw" } cdrom { file_id = format("local:iso/talos-%s-nocloud-amd64-secureboot.iso", var.worker.talos_version) } efi_disk { datastore_id = var.worker.storagepool file_format = "raw" type = "4m" } tpm_state { datastore_id = var.worker.storagepool version = "v2.0" } initialization { datastore_id = var.worker.storagepool ip_config { ipv4 { address = var.worker.node_ipv4_address gateway = var.worker.ipv4_gateway } } dns { servers = ["10.13.37.2"] } } network_device { bridge = "vmbr1" } } # resource "talos_machine_secrets" "controlplane" { # talos_version = var.controlplane.talos_version # } # # data "talos_client_configuration" "controlplane" { # cluster_name = var.controlplane.cluster_name # client_configuration = talos_machine_secrets.controlplane.client_configuration # nodes = [for k, v in var.controlplane : v.ip] # endpoints = [var.controlplane.cluster_endpoint] # }