chore: Move modules to root directory

This commit is contained in:
Peter 2026-01-26 10:57:01 +01:00
parent 649f1ba598
commit c8c4c8355b
Signed by: Peter
SSH key fingerprint: SHA256:B5tYaxBExaDm74r1px9iVeZ6F/ZDiyiy9SbBqfZYrvg
9 changed files with 3 additions and 3 deletions

View file

@ -0,0 +1,92 @@
terraform {
required_providers {
proxmox = {
source = "bpg/proxmox"
version = "0.86.0"
}
}
}
resource "proxmox_virtual_environment_vm" "talos-node" {
vm_id = var.node.id
name = var.node.name
node_name = var.node.proxmox_node
tags = ["tofu"]
bios = "ovmf"
clone {
vm_id = 10000 + tonumber(replace(var.node.talos_version, ".", ""))
retries = 3
}
cpu {
cores = var.node.cpu
sockets = 1
type = "host"
}
memory {
dedicated = var.node.memory * 1024
}
disk {
datastore_id = var.node.storagepool
interface = "virtio0"
size = var.node.disk
file_format = "raw"
}
dynamic "disk" {
for_each = tolist(var.pvc_disks)
content {
datastore_id = "nvme-fastpool"
interface = "virtio${disk.key + 1}"
size = disk.value
file_format = "raw"
}
}
network_device {
bridge = "vmbr1"
model = "virtio"
mtu = 1500
}
dynamic "network_device" {
for_each = var.node.type == "worker" ? [1] : []
content {
bridge = "vmbr2"
model = "virtio"
mtu = 9000
}
}
dynamic "hostpci" {
for_each = var.node.gpu == true ? [1] : []
content {
device = "hostpci0"
mapping = "A380_GPU"
pcie = true
rombar = true
}
}
initialization {
datastore_id = var.node.storagepool
ip_config {
ipv4 {
address = format("%s/24", var.node.ipv4_address)
gateway = var.node.ipv4_gateway
}
}
dns {
servers = ["9.9.9.9"]
}
}
lifecycle {
ignore_changes = [
clone,
]
}
}

View file

@ -0,0 +1,25 @@
variable "node" {
description = "Basic configuration for the Talos node"
type = object({
id = number
type = string
name = string
ipv4_address = string
ipv4_gateway = string
cpu = number
gpu = optional(bool, false)
memory = number
disk = string
storagepool = string
talos_version = string
cluster_name = string
kubernetes_version = string
cluster_endpoint = string
proxmox_node = string
})
}
variable "pvc_disks" {
description = "List of extra disks to attach to the node"
type = list(number)
default = []
}