diff --git a/lawndale-vm/compute.tf b/lawndale-vm/compute.tf index c194574..541dbca 100644 --- a/lawndale-vm/compute.tf +++ b/lawndale-vm/compute.tf @@ -47,6 +47,13 @@ resource "libvirt_domain" "this" { bridge = module.ipam.lawndale_interface mac = macaddress.this.address } + dynamic "network_interface" { + for_each = var.extra_interfaces + content { + bridge = network_interface.value.bridge + mac = network_interface.value.mac + } + } disk { volume_id = libvirt_volume.this.id diff --git a/lawndale-vm/variables.tf b/lawndale-vm/variables.tf index fa390ba..bec2bc0 100644 --- a/lawndale-vm/variables.tf +++ b/lawndale-vm/variables.tf @@ -122,3 +122,13 @@ variable "xslt" { description = "XSLT applied to the domain before sent to libvirt" default = null } + +variable "extra_interfaces" { + type = list(object({ + bridge = string + mac = string + })) + + description = "Extra network interfaces to attach to the VM" + default = [] +}