Skip to content

Commit

Permalink
https://github.com/paultyng/terraform-provider-unifi/issues/287
Browse files Browse the repository at this point in the history
  • Loading branch information
ionfury committed Dec 11, 2023
1 parent 6da19cf commit 42105fa
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 8 deletions.
26 changes: 23 additions & 3 deletions terraform/harvester/network.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ resource "harvester_vlanconfig" "this" {
tags = {}

# If we add additional nodes we will need specific configs for nodes.
# node_selector = {
# "kubernetes.io/hostname" : "harvester0"
# }
node_selector = {
"kubernetes.io/hostname" : "harvester0"
}

uplink {
bond_miimon = 0
Expand All @@ -43,3 +43,23 @@ resource "harvester_vlanconfig" "this" {
nics = var.harvester.uplink
}
}

resource "harvester_vlanconfig" "inventory" {
for_each = var.harvester.inventory

cluster_network_name = harvester_clusternetwork.this.name
description = "Uplink for ${each.key} to vlan ${harvester_clusternetwork.this.name}."
name = var.harvester.network_name
tags = {}

node_selector = {
"kubernetes.io/hostname" : each.value.host
}

uplink {
bond_miimon = 0
mtu = 1500
bond_mode = "balance-tlb"
nics = each.value.uplink
}
}
25 changes: 20 additions & 5 deletions terraform/network/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,21 @@ resource "unifi_network" "networks" {
dhcp_stop = cidrhost(each.value.cidr, each.value.dhcp_stop)
dhcpd_boot_enabled = false

# https://github.com/paultyng/terraform-provider-unifi/issues/287
dhcp_v6_dns = []
dhcp_v6_dns_auto = false
dhcp_v6_enabled = false
dhcp_v6_lease = 86400
dhcp_v6_start = "::2"
dhcp_v6_stop = "::7d1"
ipv6_pd_start = "::2"
ipv6_pd_stop = "::7d1"

igmp_snooping = false
ipv6_ra_enable = false
ipv6_ra_preferred_lifetime = 0
ipv6_ra_valid_lifetime = 0
multicast_dns = false
igmp_snooping = false
ipv6_ra_enable = false
ipv6_ra_priority = "high"
ipv6_ra_valid_lifetime = 0
multicast_dns = false
}

resource "unifi_port_profile" "profiles" {
Expand All @@ -33,6 +38,16 @@ resource "unifi_port_profile" "profiles" {
name = each.value.name
poe_mode = "auto"

# https://github.com/paultyng/terraform-provider-unifi/issues/287
# Reguired if you ever touch the profile in the UI
egress_rate_limit_kbps_enabled = false
egress_rate_limit_kbps = 100
stormctrl_bcast_enabled = false
stormctrl_bcast_rate = 100
stormctrl_mcast_rate = 100
stormctrl_ucast_rate = 100


native_networkconf_id = unifi_network.networks[each.value.name].id
}

Expand Down

0 comments on commit 42105fa

Please sign in to comment.