mirror of
https://github.com/optim-enterprises-bv/homelab.git
synced 2025-10-30 01:22:31 +00:00
feat(k8s): multi-node Talos cluster
This commit is contained in:
11
tofu/home-assistant/images.tf
Normal file
11
tofu/home-assistant/images.tf
Normal file
@@ -0,0 +1,11 @@
|
||||
resource "proxmox_virtual_environment_file" "haos_generic_image" {
|
||||
provider = proxmox.euclid
|
||||
node_name = var.euclid.node_name
|
||||
content_type = "iso"
|
||||
datastore_id = "local"
|
||||
|
||||
source_file {
|
||||
path = "images/haos_ova-12.3.qcow2"
|
||||
file_name = "haos_ova-12.3.img"
|
||||
}
|
||||
}
|
||||
2
tofu/home-assistant/images/download.sh
Executable file
2
tofu/home-assistant/images/download.sh
Executable file
@@ -0,0 +1,2 @@
|
||||
wget https://github.com/home-assistant/operating-system/releases/download/12.3/haos_ova-12.3.qcow2.xz
|
||||
xz -d haos_ova-12.3.qcow2.xz
|
||||
9
tofu/home-assistant/main.tf
Normal file
9
tofu/home-assistant/main.tf
Normal file
@@ -0,0 +1,9 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
proxmox = {
|
||||
source = "bpg/proxmox"
|
||||
version = ">= 0.57.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
1
tofu/home-assistant/pve_euclid.tf
Symbolic link
1
tofu/home-assistant/pve_euclid.tf
Symbolic link
@@ -0,0 +1 @@
|
||||
../machines/euclid.tf
|
||||
57
tofu/home-assistant/vm-haos.tf
Normal file
57
tofu/home-assistant/vm-haos.tf
Normal file
@@ -0,0 +1,57 @@
|
||||
resource "proxmox_virtual_environment_vm" "home_assistant" {
|
||||
provider = proxmox.euclid
|
||||
node_name = var.euclid.node_name
|
||||
|
||||
name = "Home-Assistant"
|
||||
description = "Managed by OpenTofu"
|
||||
tags = ["home-assistant"]
|
||||
on_boot = true
|
||||
bios = "ovmf"
|
||||
scsi_hardware = "virtio-scsi-single"
|
||||
|
||||
vm_id = 1000
|
||||
|
||||
tablet_device = false
|
||||
|
||||
cpu {
|
||||
cores = 2
|
||||
type = "host"
|
||||
}
|
||||
|
||||
memory {
|
||||
dedicated = 4096
|
||||
}
|
||||
|
||||
network_device {
|
||||
bridge = "vmbr0"
|
||||
mac_address = "BC:24:11:50:A6:33"
|
||||
}
|
||||
|
||||
agent {
|
||||
enabled = true
|
||||
}
|
||||
|
||||
efi_disk {
|
||||
datastore_id = "local-zfs"
|
||||
file_format = "raw" // To support qcow2 format
|
||||
type = "4m"
|
||||
}
|
||||
|
||||
disk {
|
||||
datastore_id = "local-zfs"
|
||||
file_id = proxmox_virtual_environment_file.haos_generic_image.id
|
||||
interface = "scsi0"
|
||||
cache = "writethrough"
|
||||
discard = "on"
|
||||
ssd = true
|
||||
size = 64
|
||||
}
|
||||
|
||||
operating_system {
|
||||
type = "l26" # Linux Kernel 2.6 - 5.X.
|
||||
}
|
||||
|
||||
lifecycle {
|
||||
prevent_destroy = true
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user