Newer
Older
openstack-caracal-dc-dc / opentofu / main.tf
# Root module: wires the network + storage-pool layer for VR1 (Stage 1-2 of
# docs/dc-dc-deployment-workflow.md). See opentofu/README.md for full scope,
# what is deliberately deferred, and why.

provider "libvirt" {
  uri = var.libvirt_uri
}

# ---- DC1: inherits the DC0 six-plane v4 layout unchanged (D-101) ----

module "dc1_planes" {
  source        = "./modules/dc-planes"
  dc_name       = "dc1"
  domain_suffix = var.domain_suffix
  mtu           = var.underlay_mtu
  planes        = var.dc1_planes
}

module "dc1_storage" {
  source      = "./modules/dc-storage-pool"
  dc_name     = "dc1"
  target_path = var.dc1_pool_path
}

# ---- DC2: NOT YET WIRED. ----
# D-101 has not assigned DC2's supernet yet (open sub-item). Once NetBox
# assigns it, add a `dc2_planes` variable (same shape as `dc1_planes` in
# variables.tf) and uncomment/adapt this block -- do not fill in guessed
# CIDRs to make this "work" sooner.
#
# module "dc2_planes" {
#   source        = "./modules/dc-planes"
#   dc_name       = "dc2"
#   domain_suffix = var.domain_suffix
#   mtu           = var.underlay_mtu
#   planes        = var.dc2_planes
# }
#
# module "dc2_storage" {
#   source      = "./modules/dc-storage-pool"
#   dc_name     = "dc2"
#   target_path = var.dc2_pool_path
# }

# ---- Office1 headend: its own storage pool for MAAS-region/NetBox/GitBucket
# service-VM disks (D-103). Office1 does not get a dc-planes module -- the
# six-plane template is per-OpenStack-DC, not per-headend. ----

module "office1_storage" {
  source      = "./modules/dc-storage-pool"
  dc_name     = "office1"
  target_path = var.office1_pool_path
}

# ---- The D-100 dark-fiber mesh triangle: DC1<->DC2, DC1<->Office1,
# DC2<->Office1 -- mesh, not star. All three legs created now even though DC2
# itself is not yet wired above: the LINK is independent of whether DC2's
# plane networks exist yet, and Phase 0's gate wants "virtual networks present
# and isolated as designed" before Phase 2 needs them. ----

module "mesh_dc1_dc2" {
  source    = "./modules/mesh-link"
  link_name = "dc1-dc2"
  mtu       = var.underlay_mtu
}

module "mesh_dc1_office1" {
  source    = "./modules/mesh-link"
  link_name = "dc1-office1"
  mtu       = var.underlay_mtu
}

module "mesh_dc2_office1" {
  source    = "./modules/mesh-link"
  link_name = "dc2-office1"
  mtu       = var.underlay_mtu
}