Skip to content

Commit

Permalink
Assign prefixes to VLANs
Browse files Browse the repository at this point in the history
  • Loading branch information
mraerino committed Mar 23, 2024
1 parent bf723fd commit b02ca69
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions modules/device/networks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ resource "netbox_prefix" "local_v4" {
resource "netbox_prefix" "networks_v4" {
for_each = netbox_vlan.networks

vrf_id = netbox_vrf.local.id
prefix = cidrsubnet(var.client_prefix_v4, 8, each.value.vid)
vrf_id = netbox_vrf.local.id
vlan_id = each.value.id
prefix = cidrsubnet(var.client_prefix_v4, 8, each.value.vid)

status = "active"
description = "'${each.value.name}' network for ${var.name}"
Expand All @@ -21,8 +22,9 @@ resource "netbox_prefix" "networks_v4" {
resource "netbox_prefix" "networks_v6" {
for_each = netbox_vlan.networks

vrf_id = netbox_vrf.local.id
prefix = cidrsubnet(netbox_available_prefix.site_v6.prefix, 8, each.value.vid)
vrf_id = netbox_vrf.local.id
vlan_id = each.value.id
prefix = cidrsubnet(netbox_available_prefix.site_v6.prefix, 8, each.value.vid)

status = "active"
description = "'${each.value.name}' network for ${var.name}"
Expand Down

0 comments on commit b02ca69

Please sign in to comment.