be53170557
Stop repeating the site slug inside the YAML: terragrunt passes the dc as site_slug and site.yaml carries only site-wide attributes. Declare device types, roles, platforms, custom fields and the dhcp IPAM role once in config/global via their own unit and state; the per-site unit looks them up by slug or name.
20 lines
843 B
Terraform
20 lines
843 B
Terraform
# Custom-field DEFINITIONS: what bootapi needs NetBox to carry before it can
|
|
# pick anything but the default distro.
|
|
#
|
|
# Definitions only. Values are set where they are owned:
|
|
# provision_template -> by the UI/autodiscovery, on the device
|
|
# pxe_enabled -> NOT managed here. It is runtime state: bootapi's
|
|
# /provisioned callback clears it at the end of an
|
|
# install so a host does not re-image on its next PXE.
|
|
# Setting it from terraform would re-enable installs on
|
|
# every apply.
|
|
resource "netbox_custom_field" "this" {
|
|
for_each = var.custom_fields
|
|
|
|
name = each.key
|
|
type = each.value.type
|
|
content_types = each.value.content_types
|
|
label = each.value.label
|
|
description = each.value.description
|
|
}
|