Newer
Older
openstack-caracal-dc-dc / opentofu / modules / mesh-link / main.tf
# mesh-link: one dedicated virtual L2 segment standing in for a dark-fiber leg
# of the D-100 triangle (DC1<->DC2, DC1<->Office1, DC2<->Office1 -- mesh, not
# star). Same isolated-network shape as dc-planes/main.tf and for the same
# reason: this is a bare L2 wire, not something libvirt should route or NAT.
#
# WAN SIMULATION (tc netem) IS DELIBERATELY NOT HERE. `libvirt_network` has no
# netem-equivalent argument (confirmed against the current schema) -- netem is
# a Linux traffic-control setting applied to the bridge interface THIS resource
# creates, at the OS level (`tc qdisc add dev <bridge> ...`), after the network
# exists. That is a separate, not-yet-authored piece (a null_resource with a
# provisioner, or a small companion script) -- exact parameters are themselves
# a Phase-0 open item (D-100). Do not fabricate a netem argument on this
# resource to fill the gap; track it as real follow-up work instead (see
# opentofu/README.md).

# SYNTAX NOTE (corrected 2026-07-09): attribute-style (`mtu = { ... }`), not
# block syntax -- see dc-planes/main.tf's note for the verification source.

resource "libvirt_network" "link" {
  name      = "mesh-${var.link_name}"
  autostart = true

  mtu = {
    size = var.mtu
  }
}