paultyng / terraform-provider-unifi

Terraform provider for Unifi :satellite:
https://registry.terraform.io/providers/paultyng/unifi/latest/docs
Mozilla Public License 2.0
505 stars 90 forks source link

Support for unifi network version 7.4.XX ? #360

Open ednxzu opened 1 year ago

ednxzu commented 1 year ago

Ubiquiti released an update to (at least) the udm pro, and most of its hardware, bringing network v 7.4.XX, which changes quite a few things in terms of port configuration, port profiles, etc... The current latest version of the provider does not work with it, most port_profile features are unusable (VLAN tagging doesnt work because of the changes on the unifi side).

Is a new version being worked on to support this new software version ?

Cheers,

joshuaspence commented 1 year ago

We only support stable releases, I think 7.4 is still in EA?

ednxzu commented 1 year ago

Oh yes, you might be right. Sorry about that...

ednxzu commented 1 year ago

I'm reopening this issue since unifi network 7.4 has been GA'd

issacg commented 1 year ago

I just ran into this myself after an unplanned upgrade from 7.3

Basic functionality seems to still work, though I'm a bit paranoid of what is/isn't happening behind the scenes.

This snippet is working for me so far to replace the old built-in port_profiles. And since port_profiles are currently the only way to manage port_overrides on a switch device, that's the only way I seem to be able to work now.

I'm posting this in hopes of 1) inspiring others and 2) maybe getting critique on important things I may have overlooked in my rush job to fix this for myself.

data "unifi_network" "default" {
  name = "Default"
}

resource "unifi_port_profile" "all" {
  name = "All"

  forward               = "all"
  full_duplex           = "true"
  poe_mode              = "auto"
  native_networkconf_id = data.unifi_network.default.id
}

resource "unifi_port_profile" "disabled" {
  name     = "Disabled"
  forward  = "disabled"
  poe_mode = "off"
}
ednxzu commented 1 year ago

I "fixed" it aswell on my side a few months ago.

resource "unifi_port_profile" "trunk" {
  name                  = "trunk"
  autoneg               = true
  lldpmed_enabled       = false
  native_networkconf_id = unifi_network.default_network.id
  poe_mode              = "auto"
  forward               = "all"
}

resource "unifi_port_profile" "native_mgt" {
  name                  = "native_mgt"
  autoneg               = true
  lldpmed_enabled       = false
  native_networkconf_id = unifi_network.default_network.id
  poe_mode              = "auto"
}

resource "unifi_port_profile" "native_10" {
  name                  = "native_10"
  autoneg               = true
  lldpmed_enabled       = false
  native_networkconf_id = unifi_network.vlan_10.id
  poe_mode              = "auto"
}

resource "unifi_port_profile" "native_20" {
  name                  = "native_20"
  autoneg               = true
  lldpmed_enabled       = false
  native_networkconf_id = unifi_network.vlan_20.id
  poe_mode              = "auto"
}

Adding a single network to a port, or making a trunk profile works, even tho it's a hack. Tagging multiple VLANs on a port is not possible with the current resource. It's only possible to make single VLAN profiles untagged, or trunk profile.

evenh commented 11 months ago

I'm blocked on this as well

ednxzu commented 10 months ago

Update: changes have been made by this kind stranger. might be worth looking into at least for the port_profile port which I think it the most painful issue right now.

wesleykirkland commented 3 weeks ago

@paultyng I ran across your provider tonight and was doing a full config of network with IaC. I'm encountering this issue as well, it's a single native VLAN or a full Trunk profile which is not always desired. Is it possible to get the fix mentioned above merged in please?