Add k3s nucs to KEA and DNS
Some checks failed
/ authentik (push) Failing after 43s
/ non-lab (push) Failing after 14m34s

This commit is contained in:
Chris Cowley 2025-04-16 11:47:40 +02:00
parent 4d414c88f0
commit 05d4287d05
4 changed files with 94 additions and 1 deletions

View file

@ -10,3 +10,23 @@ resource "opnsense_unbound_host_override" "esphome" {
domain = "home.cowley.tech"
server = each.value.address
}
resource "opnsense_unbound_host_override" "physical_home" {
for_each = { for i, v in var.physical_home : i => v }
enabled = true
description = each.value.name
hostname = each.value.name
domain = "home.cowley.tech"
server = each.value.address
}
resource "opnsense_unbound_host_override" "physical_lab" {
for_each = { for i, v in var.physical_lab : i => v }
enabled = true
description = each.value.name
hostname = each.value.name
domain = "lab.cowley.tech"
server = each.value.address
}

View file

@ -13,3 +13,19 @@ resource "opnsense_kea_reservation" "esphome" {
mac_address = each.value.mac
description = "Lease for ${each.value.name}"
}
resource "opnsense_kea_reservation" "physical_home" {
for_each = { for i, v in var.physical_home : i => v }
subnet_id = opnsense_kea_subnet.subnets["home"].id
ip_address = each.value.address
mac_address = each.value.mac
description = "Lease for ${each.value.name}"
}
resource "opnsense_kea_reservation" "physical_lab" {
for_each = { for i, v in var.physical_lab : i => v }
subnet_id = opnsense_kea_subnet.subnets["lab"].id
ip_address = each.value.address
mac_address = each.value.mac
description = "Static IP for ${each.value.name}"
}

View file

@ -1,3 +1,47 @@
physical_lab = [
{
name = "kubemaster0"
address = "192.168.6.5"
mac = "c0:3f:d5:6a:02:a3"
},
{
name = "agent0"
address = "192.168.6.58"
mac = "c0:3f:d5:63:7b:3c"
},
{
name = "agent1"
address = "192.168.6.60"
mac = "b8:ae:ed:7f:bc:45"
},
{
name = "agent2"
address = "192.168.6.61"
mac = "c0:3f:d5:66:ba:79"
},
]
physical_home = [
{
name = "kodi"
address = "192.168.5.139"
mac = "2c:cf:67:77:69:85"
},
{
name = "zigbee"
address = "192.168.5.123"
mac = "b8:27:eb:db:2e:30"
},
{
name = "hpenvy"
address = "192.168.5.89"
mac = "84:2a:fd:42:6c:ad"
},
{
name = "brother"
address = "192.168.5.95"
mac = "00:90:4c:c5:12:38"
},
]
esphome_boards = [
{
name = "gate"

View file

@ -1,4 +1,17 @@
variable "physical_lab" {
type = list(object({
name = string
address = string
mac = string
}))
}
variable "physical_home" {
type = list(object({
name = string
address = string
mac = string
}))
}
variable "esphome_boards" {
type = list(object({
name = string