opentofu: decommission stopped pre-k8s guests (migration rollback net) #75

Merged
k.renner merged 1 commits from decommission-pre-k8s-guests into master 2026-06-27 10:38:10 +00:00
11 changed files with 0 additions and 569 deletions
-13
View File
@@ -20,26 +20,13 @@ locals {
# VMs
[
"102", # fortress
"103", # homeassistant
"108", # influxdb
"109", # grafana
"111", # paperless
],
# LXCs
[
"114", # gitea
"118", # proxmox-dns-1 (jupiter)
"121", # ical-proxy
"130", # authentik-app-1
"131", # authentik-app-2
"132", # authentik-db-1
"133", # authentik-db-2
"212", # audiobookshelf
"218", # proxmox-dns-2 (saturn)
"225", # immich
"226", # loki
"227", # prometheus
"229", # music-assistant
"231", # woodpecker
"318", # proxmox-dns-3 (neptune)
],
-34
View File
@@ -1,34 +0,0 @@
module "ical_proxy" {
source = "./modules/proxmox_lxc"
hostname = "ical-proxy.srv.renner.uno"
vmid = 121
target_node = "jupiter"
memory = 512
cores = 1
# ip_address = "10.2.40.21"
mac_address = "bc:24:11:1c:a1:21"
tags = "docker;ical_proxy"
storage = "local-zfs"
# ssh_public_keys = local.common_ssh_keys
ssh_public_keys = null
start = false
onboot = false
# CNAME retired: K8s apps/ical-proxy Ingress owns ical-proxy.renner.uno.
ingress_cnames = []
}
moved {
from = proxmox_lxc.ical_proxy_srv_renner_uno
to = module.ical_proxy.proxmox_lxc.this
}
moved {
from = unifi_client.ical_proxy
to = module.ical_proxy.unifi_client.this[0]
}
-84
View File
@@ -1,84 +0,0 @@
moved {
from = proxmox_lxc.lxc["212"]
to = proxmox_lxc.audiobookshelf
}
module "audiobookshelf" {
source = "./modules/proxmox_lxc"
target_node = "jupiter"
hostname = "audiobookshelf.srv.renner.uno"
vmid = 212
memory = 2048
cores = 2
onboot = false
cpuunits = 1024
tags = "audiobook;community-script;podcast"
hagroup = "olymp"
hastate = "stopped"
unprivileged = false
start = false
storage = "local-zfs"
disk_size = "5G"
mountpoints = [
{
key = "mp0"
slot = 0
storage = "local-zfs"
mp = "/metadata"
size = "20G"
backup = true
},
{
key = "mp1"
slot = 1
storage = "local-zfs" # Or wherever the main media should go if different
mp = "/audiobooks"
size = "200G"
backup = true
}
]
# CNAME retired: K8s apps/audiobookshelf Ingress owns the hostname.
ingress_cnames = []
description = <<-EOT
<div align='center'>
<a href='https://Helper-Scripts.com' target='_blank' rel='noopener noreferrer'>
<img src='https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/images/logo-81x112.png' alt='Logo' style='width:81px;height:112px;'/>
</a>
<h2 style='font-size: 24px; margin: 20px 0;'>audiobookshelf LXC</h2>
<p style='margin: 16px 0;'>
<a href='https://ko-fi.com/community_scripts' target='_blank' rel='noopener noreferrer'>
<img src='https://img.shields.io/badge/&#x2615;-Buy us a coffee-blue' alt='spend Coffee' />
</a>
</p>
<span style='margin: 0 10px;'>
<i class="fa fa-github fa-fw" style="color: #f5f5f5;"></i>
<a href='https://github.com/community-scripts/ProxmoxVE' target='_blank' rel='noopener noreferrer' style='text-decoration: none; color: #00617f;'>GitHub</a>
</span>
<span style='margin: 0 10px;'>
<i class="fa fa-comments fa-fw" style="color: #f5f5f5;"></i>
<a href='https://github.com/community-scripts/ProxmoxVE/discussions' target='_blank' rel='noopener noreferrer' style='text-decoration: none; color: #00617f;'>Discussions</a>
</span>
<span style='margin: 0 10px;'>
<i class="fa fa-exclamation-circle fa-fw" style="color: #f5f5f5;"></i>
<a href='https://github.com/community-scripts/ProxmoxVE/issues' target='_blank' rel='noopener noreferrer' style='text-decoration: none; color: #00617f;'>Issues</a>
</span>
</div>
EOT
}
moved {
from = proxmox_lxc.audiobookshelf
to = module.audiobookshelf.proxmox_lxc.this
}
-47
View File
@@ -1,47 +0,0 @@
moved {
from = proxmox_lxc.lxc["225"]
to = proxmox_lxc.immich_srv_renner_uno
}
module "immich_srv_renner_uno" {
source = "./modules/proxmox_lxc"
target_node = "jupiter"
hostname = "immich.srv.renner.uno"
vmid = 225
memory = 8192
cores = 8
unprivileged = true
cpuunits = 1024
tags = "docker;immich;media"
hagroup = "olymp"
hastate = "stopped"
storage = "local-zfs"
disk_size = "32G"
mountpoints = [
{
key = "mp0"
slot = 0
storage = "local-zfs"
mp = "/mnt/media/immich"
size = "250G"
backup = true
}
]
start = false
onboot = false
# CNAME retired: photos.renner.uno added as alias on the K8s
# apps/immich Ingress; external-dns-unifi takes over the A record.
ingress_cnames = []
}
moved {
from = proxmox_lxc.immich_srv_renner_uno
to = module.immich_srv_renner_uno.proxmox_lxc.this
}
-45
View File
@@ -1,45 +0,0 @@
# Loki Log Aggregation Server
# Centralized log collection using Grafana Loki
# Part of the observability stack with Prometheus and Grafana
module "loki_srv_renner_uno" {
source = "./modules/proxmox_lxc"
hostname = "loki.srv.renner.uno"
vmid = 226
target_node = "jupiter"
memory = 2048
cores = 2
unprivileged = true
network_bridge = "v40srv"
storage = "local-zfs"
disk_size = "80G" # 90-day log retention
ostemplate = "local:vztmpl/debian-12-standard_12.12-1_amd64.tar.zst"
ssh_public_keys = local.common_ssh_keys
tags = "monitoring;logging;infrastructure;netbird_client"
onboot = false
start = false
features = {
nesting = false
fuse = false
keyctl = false
mknod = false
}
# CNAME retired: K8s apps/monitoring loki-ingress owns loki.renner.uno.
ingress_cnames = []
cnames = []
}
output "loki_hostname" {
value = "loki.srv.renner.uno"
description = "Loki log aggregation server hostname"
}
-46
View File
@@ -1,46 +0,0 @@
# Prometheus Metrics Server
# Centralized metrics collection and storage
# Part of the observability stack with Loki and Grafana
module "prometheus_srv_renner_uno" {
source = "./modules/proxmox_lxc"
hostname = "prometheus.srv.renner.uno"
vmid = 227
target_node = "neptune"
memory = 1024
cores = 2
unprivileged = true
network_bridge = "v40srv"
storage = "local-zfs"
disk_size = "50G" # 90-day metrics retention
ostemplate = "local:vztmpl/debian-12-standard_12.12-1_amd64.tar.zst"
ssh_public_keys = local.common_ssh_keys
tags = "monitoring;metrics;infrastructure;netbird_client"
onboot = false
start = false
features = {
nesting = false
fuse = false
keyctl = false
mknod = false
}
# CNAME retired: prometheus LXC retiring, no K8s replacement on this
# hostname. prometheus.renner.uno will stop resolving.
ingress_cnames = []
cnames = []
}
output "prometheus_hostname" {
value = "prometheus.srv.renner.uno"
description = "Prometheus metrics server hostname"
}
-49
View File
@@ -1,49 +0,0 @@
module "music_assistant" {
source = "./modules/proxmox_lxc"
target_node = "neptune" # Same node as Home Assistant for optimal latency
hostname = "music-assistant.iot.renner.uno"
vmid = 229
memory = 4096
cores = 2
# Must be on same network as Home Assistant for mDNS/uPnP discovery
network_bridge = "v30iot"
onboot = false
cpuunits = 1024
tags = "music-assistant;docker;home-assistant"
hagroup = "olymp"
hastate = "stopped"
# Unprivileged with nesting for Docker
unprivileged = true
start = false
features = {
nesting = true # Required for Docker
fuse = false
keyctl = false
}
storage = "local-zfs"
disk_size = "20G"
ssh_public_keys = local.common_ssh_keys
# CNAME retired: K8s apps/music-assistant Ingress owns music.renner.uno.
ingress_cnames = []
description = <<-EOT
Music Assistant - Music library manager for Home Assistant
https://music-assistant.io/
Deployed via Ansible role: music-assistant
Web UI: http://music-assistant.iot.renner.uno:8095
Streaming: Port 8097
Slimproto: Port 3483
Must be on same L2 network as Home Assistant for mDNS discovery.
EOT
}
-116
View File
@@ -1,116 +0,0 @@
module "authentik_db_1" {
source = "./modules/proxmox_lxc"
target_node = "jupiter"
hostname = "authentik-db-1.srv.renner.uno"
vmid = 132
memory = 2048
cores = 2
unprivileged = true
hastate = "stopped"
storage = "local-zfs"
disk_size = "20G"
network_bridge = "v40srv"
start = false
onboot = false
ssh_public_keys = local.common_ssh_keys
tags = "authentik,db"
}
module "authentik_db_2" {
source = "./modules/proxmox_lxc"
target_node = "saturn"
hostname = "authentik-db-2.srv.renner.uno"
vmid = 133
memory = 2048
cores = 2
unprivileged = true
hastate = "stopped"
storage = "local-zfs"
disk_size = "20G"
network_bridge = "v40srv"
start = false
onboot = false
ssh_public_keys = local.common_ssh_keys
tags = "authentik,db"
}
module "authentik_app_1" {
source = "./modules/proxmox_lxc"
target_node = "neptune"
hostname = "authentik-app-1.srv.renner.uno"
vmid = 130
memory = 4096
cores = 4
unprivileged = true
# nesting = true # Default is true via features variable
hastate = "stopped"
storage = "local-zfs"
disk_size = "32G"
network_bridge = "v40srv"
start = false
onboot = false
ssh_public_keys = local.common_ssh_keys
tags = "authentik,app,docker"
}
module "authentik_app_2" {
source = "./modules/proxmox_lxc"
target_node = "jupiter"
hostname = "authentik-app-2.srv.renner.uno"
vmid = 131
memory = 4096
cores = 4
unprivileged = true
# nesting = true # Default is true via features variable
hastate = "stopped"
storage = "local-zfs"
disk_size = "32G"
network_bridge = "v40srv"
start = false
onboot = false
ssh_public_keys = local.common_ssh_keys
tags = "authentik,app,docker"
}
# DNS Records for the new infrastructure are handled via 'cnames' in the module
# which creates unifi_dns_record resources dynamically based on the hostname.
# Virtual IP for Database HA
# Keepalived manages the VIP (10.2.40.135) between authentik-db-1 and authentik-db-2
# When primary fails, keepalived automatically moves the VIP to the standby
# DNS points to the VIP for automatic failover without DNS changes
resource "unifi_dns_record" "authentik_db" {
name = "authentik-db.renner.uno"
record_type = "A"
value = "10.2.40.135" # Keepalived VIP - floats between DB nodes
enabled = true
ttl = 60
}
-42
View File
@@ -1,42 +0,0 @@
module "homeassistant_srv_renner_uno" {
source = "./modules/proxmox_vm"
name = "homeassistant.iot.renner.uno"
target_node = "neptune"
vmid = 103
memory = 16384
cores = 8
mac_address = "2e:05:b6:30:a3:cf"
network_bridge = "v30iot"
disks = [
{
storage = "local-zfs"
size = "64G"
format = "raw"
discard = true
}
]
# USB devices (stromzaehler + ZWA-2) were rebinded to vm_153 (k8s-edge)
# at the HA cutover and are no longer attached to vm_103. The legacy
# HAOS VM stays defined here for snapshot/rollback access only and is
# being held in vm_state="stopped". Removing the usb block here matches
# live Proxmox state -- otherwise tofu would re-attach the devices.
tags = "noansible"
hastate = "stopped"
vm_state = "stopped"
onboot = false
agent_trim = true
cloud_init = false
full_clone = false
template_name = null
cnames = []
}
moved {
from = proxmox_vm_qemu.homeassistant_srv_renner_uno
to = module.homeassistant_srv_renner_uno.proxmox_vm_qemu.this
}
-46
View File
@@ -1,46 +0,0 @@
moved {
from = proxmox_vm_qemu.influxdb_srv_renner_uno
to = module.influxdb_srv_renner_uno.proxmox_vm_qemu.this
}
moved {
from = unifi_client.influxdb
to = module.influxdb_srv_renner_uno.unifi_client.this
}
module "influxdb_srv_renner_uno" {
source = "./modules/proxmox_vm"
name = "influxdb.srv.renner.uno"
target_node = "jupiter"
vmid = 108
memory = 4096
cores = 4
mac_address = "bc:24:11:10:29:c0"
ip_address = "10.2.40.16"
disks = [
{
storage = "local-zfs"
size = "43212M"
}
]
ssh_public_keys = local.common_ssh_keys
# CNAMEs retired: influxdb VM retiring, no K8s replacement on these
# hostnames. influx.renner.uno and influxdb.renner.uno will stop
# resolving.
ingress_cnames = []
# Match existing state
template_name = null
full_clone = false
bios = "ovmf"
boot = " "
automatic_reboot = true
tablet = false
vm_state = "stopped"
onboot = false
}
-47
View File
@@ -1,47 +0,0 @@
moved {
from = proxmox_vm_qemu.grafana_srv_renner_uno
to = module.grafana_srv_renner_uno.proxmox_vm_qemu.this
}
moved {
from = unifi_client.grafana
to = module.grafana_srv_renner_uno.unifi_client.this
}
module "grafana_srv_renner_uno" {
source = "./modules/proxmox_vm"
name = "grafana.srv.renner.uno"
target_node = "neptune"
vmid = 109
memory = 2048
cores = 4
mac_address = "bc:24:11:ae:a8:0c"
ip_address = "10.2.40.17"
disks = [
{
storage = "local-zfs"
size = "43212M"
}
]
tags = "eol;noansible"
ssh_public_keys = local.common_ssh_keys
# CNAME retired: grafana VM retiring, no K8s replacement on this
# hostname. grafana.renner.uno will stop resolving.
ingress_cnames = []
# Match existing state
template_name = null
full_clone = false
bios = "ovmf"
boot = " "
automatic_reboot = true
tablet = false
vm_state = "stopped"
hastate = "stopped"
onboot = false
}