Files
terraform-infra/modules/infra/variables.tf
unkinben 9a6f775300
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/plan Pipeline failed
Rename terraform-ipam -> terraform-infra; add devices + networks + puppetdb backfill
Scope now spans devices and provisioning, not just IPAM.

- rename module/consul-path/role ipam -> infra
- networks config (subnet binding + gateway/dns/search constants); prefixes tagged net:<name>
- intent-only devices module: netbox_device + device_type/role/manufacturer, static or
  next-available IPs (sticky via ignore_changes), transitional bootstrap_mac interface for
  bootapi PXE keying
- seed 6 pending hosts prodnxsr0014-0019 (mgmt IPs .14-.19, optiplex-3070)
- ci/puppetdb_backfill.py: emit NetBox reality (serial/model/uuid/interfaces) for existing hosts

Claude-Session: https://claude.ai/code/session_01JUoARVdmhxKQHyyyp1pxeT
2026-08-05 19:41:41 +10:00

86 lines
2.5 KiB
Terraform

variable "subnets" {
description = "Map of subnets keyed by name (config file basename)."
type = map(object({
prefix = string
description = optional(string, "")
site = optional(string)
router = optional(number)
dns = optional(list(string), [])
next_server = optional(string)
domain = optional(string)
dhcp = optional(object({
enabled = optional(bool, true)
start = number
stop = number
}))
}))
default = {}
}
variable "networks" {
description = <<-EOT
Named logical networks devices join, keyed by network name. `subnet` binds the
network to a subnet (its prefix is tagged net:<name> and used for device IP
allocation). gateway/dns/search are per-network provisioning constants (carried
for downstream consumers; not per-device).
EOT
type = map(object({
subnet = string
gateway = optional(string)
dns = optional(list(string), [])
search = optional(string)
}))
default = {}
}
variable "devices" {
description = <<-EOT
Intent-only device declarations keyed by device name. Reality (serial, real
interface names, MACs) is owned by discovery/PuppetDB, not this file.
`networks` maps a network name to a requested IP in CIDR form, or "" to
allocate the next-available from the network's prefix. `bootstrap_mac` is
transitional: it seeds a placeholder interface so bootapi can key the PXE boot
on MAC until the discovery image exists.
EOT
type = map(object({
site = string
role = string
model_hint = optional(string)
provision = optional(object({
profile = optional(string)
platform = optional(string)
}))
networks = optional(map(string), {})
pxe = optional(bool, false)
bootstrap_mac = optional(string)
}))
default = {}
}
variable "managed_ips" {
description = "Manually managed extra IP addresses (full CIDR form, e.g. 198.18.15.5/24)."
type = list(object({
ip = string
description = optional(string, "")
}))
default = []
}
variable "vault_address" {
description = "Vault server address for the token data source."
type = string
default = "https://vault.service.consul:8200"
}
variable "netbox_server_url" {
description = "NetBox server base URL."
type = string
default = "https://netbox.k8s.syd1.au.unkin.net"
}
variable "kea_endpoint" {
description = "KeaAPI base URL (in-cluster ClusterIP service)."
type = string
default = "http://kea-api.dhcp-system.svc:8080"
}