Files
tf-infra/incus/modules/network/main.tf
Guy Godfroy 36eaa727ab Refactor network module to accept free-form config maps
Replace hypervisor_parent/witness_parent strings with hypervisor_config
and witness_config map(string) variables, matching the pattern already
used by the storage module. incus_networks in the root module is updated
from map(number) to map(object) carrying type and the two config maps.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-15 14:05:40 +01:00

33 lines
575 B
HCL

terraform {
required_providers {
incus = {
source = "lxc/incus"
}
}
}
resource "incus_network" "hypervisor" {
for_each = var.hypervisors
name = var.name
target = each.key
type = var.type
config = var.hypervisor_config
}
resource "incus_network" "witness" {
for_each = var.witnesses
name = var.name
target = each.key
type = var.type
config = var.witness_config
}
resource "incus_network" "this" {
depends_on = [
incus_network.hypervisor,
incus_network.witness,
]
name = var.name
type = var.type
}