Update terraform/main.tf
This commit is contained in:
@@ -1,9 +1,46 @@
|
|||||||
terraform {
|
data "template_file" "talos_cloudinit" {
|
||||||
required_version = ">= 1.0"
|
template = file("${path.module}/cloudinit/talos-userdata.yaml")
|
||||||
|
vars = {
|
||||||
|
hostname = "talos-0"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Geen cloud nodig — alleen local provider
|
|
||||||
resource "local_file" "test" {
|
resource "proxmox_cloudinit_template" "talos" {
|
||||||
content = "Hello from Terraform 🚀"
|
name = "talos-cloudinit"
|
||||||
filename = "${path.module}/hello.txt"
|
target_node = "nuctyzyzen7-1"
|
||||||
|
storage = "local"
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "proxmox_vm_qemu" "talos" {
|
||||||
|
count = var.node_count
|
||||||
|
name = "talos-${count.index}"
|
||||||
|
target_node = "nuctyzyzen7-1"
|
||||||
|
|
||||||
|
cores = 2
|
||||||
|
memory = 4096
|
||||||
|
scsihw = "virtio-scsi-pci"
|
||||||
|
|
||||||
|
# Base disk
|
||||||
|
disk {
|
||||||
|
slot = 0
|
||||||
|
size = "24G"
|
||||||
|
type = "scsi"
|
||||||
|
storage = "zfs1"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Cloud‑Init drive
|
||||||
|
cloudinit {
|
||||||
|
user_data = data.template_file.talos_cloudinit.rendered
|
||||||
|
}
|
||||||
|
|
||||||
|
# Network
|
||||||
|
network {
|
||||||
|
id = 0
|
||||||
|
model = "virtio"
|
||||||
|
bridge = var.network_bridge
|
||||||
|
}
|
||||||
|
|
||||||
|
# Boot order zonder ISO
|
||||||
|
boot = "order=scsi0;net0"
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user