2025-04-15 12:01:56 +00:00
|
|
|
resource "opnsense_kea_subnet" "subnets" {
|
|
|
|
for_each = var.dhcp_subnets
|
|
|
|
|
|
|
|
subnet = each.value
|
|
|
|
description = "${each.key} LAN"
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "opnsense_kea_reservation" "esphome" {
|
|
|
|
for_each = { for i, v in var.esphome_boards : 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}"
|
|
|
|
}
|
2025-04-16 11:47:40 +02:00
|
|
|
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}"
|
|
|
|
}
|
2025-04-17 15:15:03 +02:00
|
|
|
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}"
|
|
|
|
}
|