Many things
Some checks failed
/ non-lab (push) Waiting to run
/ authentik (push) Has been cancelled

This commit is contained in:
Chris Cowley 2025-04-17 15:15:03 +02:00
parent 05d4287d05
commit 4ecb167ff6
5 changed files with 52 additions and 67 deletions

View file

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

View file

@ -29,3 +29,11 @@ resource "opnsense_kea_reservation" "physical_lab" {
mac_address = each.value.mac
description = "Static IP for ${each.value.name}"
}
resource "opnsense_kea_reservation" "iot_devices" {
for_each = { for i, v in var.iot_devices : i => v }
subnet_id = opnsense_kea_subnet.subnets["iot"].id
ip_address = each.value.address
mac_address = each.value.mac
description = "Static IP for ${each.value.description}"
}

View file

@ -19,6 +19,16 @@ physical_lab = [
address = "192.168.6.61"
mac = "c0:3f:d5:66:ba:79"
},
{
name = "hc401"
address = "192.168.6.46"
mac = "00:1e:06:49:24:45"
},
{
name = "nut01"
address = "192.168.6.47"
mac = "b8:27:eb:4a:7e:04"
},
]
physical_home = [
{
@ -71,3 +81,18 @@ dhcp_subnets = {
home = "192.168.5.0/24"
lab = "192.168.6.0/24"
}
iot_devices = [
{
name = "garage-water-heater"
address = "192.168.3.3"
mac = "ac:0b:fb:da:42:8e"
description = "garage-water-heater"
},
{
name = "shelly1minig3-cc8da25df93c"
address = "192.168.3.4"
mac = "cc:8d:a2:5d:f9:3c"
description = "gate-relay"
},
]

View file

@ -19,6 +19,14 @@ variable "esphome_boards" {
mac = string
}))
}
variable "iot_devices" {
type = list(object({
name = string
address = string
mac = string
description = string
}))
}
variable "dhcp_subnets" {
type = map(string)
}