From 17f9c2b7c7885271af518727463f191d8fd63b8a Mon Sep 17 00:00:00 2001 From: unkin-agent Date: Sat, 3 Oct 2026 18:06:07 +1000 Subject: [PATCH] Create the chassis_mac field before the devices that carry it --- modules/netbox/catalogue.tf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/netbox/catalogue.tf b/modules/netbox/catalogue.tf index 9b01269..bb6c21f 100644 --- a/modules/netbox/catalogue.tf +++ b/modules/netbox/catalogue.tf @@ -71,4 +71,7 @@ resource "netbox_device" "network" { serial = each.value.serial asset_tag = each.value.asset_tag custom_fields = each.value.chassis_mac != null ? { chassis_mac = lower(each.value.chassis_mac) } : null + + # chassis_mac must exist as a field before a device can carry a value for it. + depends_on = [netbox_custom_field.this] }