feat: Create nodes from templates
This commit is contained in:
parent
8f7e83d818
commit
2dcd54fe4b
13 changed files with 230 additions and 143 deletions
|
|
@ -12,16 +12,9 @@ resource "proxmox_virtual_environment_vm" "talos-node" {
|
|||
name = var.node.name
|
||||
node_name = var.node.proxmox_node
|
||||
tags = ["tofu"]
|
||||
bios = "ovmf"
|
||||
on_boot = true
|
||||
machine = "q35"
|
||||
stop_on_destroy = true
|
||||
|
||||
operating_system {
|
||||
type = "l26"
|
||||
}
|
||||
agent {
|
||||
enabled = true
|
||||
clone {
|
||||
vm_id = 10000 + tonumber(replace(var.node.talos_version, ".", ""))
|
||||
}
|
||||
|
||||
cpu {
|
||||
|
|
@ -37,7 +30,6 @@ resource "proxmox_virtual_environment_vm" "talos-node" {
|
|||
disk {
|
||||
datastore_id = var.node.storagepool
|
||||
interface = "virtio0"
|
||||
import_from = var.talos_image_id
|
||||
size = var.node.disk
|
||||
file_format = "raw"
|
||||
}
|
||||
|
|
@ -52,17 +44,6 @@ resource "proxmox_virtual_environment_vm" "talos-node" {
|
|||
}
|
||||
}
|
||||
|
||||
efi_disk {
|
||||
datastore_id = var.node.storagepool
|
||||
file_format = "raw"
|
||||
type = "4m"
|
||||
}
|
||||
|
||||
tpm_state {
|
||||
datastore_id = var.node.storagepool
|
||||
version = "v2.0"
|
||||
}
|
||||
|
||||
initialization {
|
||||
datastore_id = var.node.storagepool
|
||||
ip_config {
|
||||
|
|
@ -72,11 +53,7 @@ resource "proxmox_virtual_environment_vm" "talos-node" {
|
|||
}
|
||||
}
|
||||
dns {
|
||||
servers = ["10.13.37.2"]
|
||||
servers = ["192.168.1.2"]
|
||||
}
|
||||
}
|
||||
|
||||
network_device {
|
||||
bridge = "vmbr1"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue