Commit Graph

63 Commits

Author SHA1 Message Date
Mateusz Filipowicz
325d7b7f20 feat: initialize Terraform Plugin Framework (#23)
* feat: initialize Terraform Plugin Framework

* fix docker-compose path for tests

* fix: ensure documentation can be generated with old provider SDK and new plugin framework

* lint
2025-02-24 00:11:41 +01:00
Jamie Wark
65e1701bc5 Add wlan tuning (#312)
* Add wlan tuning

* proxy_arp
* bss_transition
* fast_roaming_enabled

* Fix punctuation

* Default `bss_transition` to `true`

* Improve tests

* Tweak descriptions

* Fix tests

* Fix tests

---------

Co-authored-by: Joshua Spence <josh@spence.com.au>
2023-03-10 14:15:35 +11:00
Paul Tyng
0401ae6913 Add support for port aggregation (#182)
* Add support for port aggregation

Fixes #142

* Return `*unifi.Device` from `allocateDevice`

* Merge `TestAccDevice_switch_portOverrides` and `TestAccDevice_remove_portOverrides`

* Add tests

Note that only switches with a Broadcom, Microsemi or Nephos chipset support both port mirroring and port aggregation.

```java
package com.ubnt.data;

public class Device extends X implements Sanitizable
{

  // ...

  public int getMaxMirrorSession() {
    int n = 0;
    if (this.getModel() == Model.\u00f8\u00f50000) {
      n = 2;
    }
    else if (this.isBroadcomSwitch() || this.isMicrosemiSwitch() || this.isMediaTekSwitch() || this.isNephosSwitch()) {
      n = 1;
    }
    return this.thisforObject().getInt("max_mirror_sessions", n);
  }

  public int getMaxAggregation() {
    int n = 0;
    if (this.isBroadcomSwitch() || this.isMicrosemiSwitch() || this.isNephosSwitch()) {
      n = 6;
    }
    return this.thisforObject().getInt("max_aggregate_sessions", n);
  }

  // ...

  public boolean isBroadcomSwitch() {
    final Model model = this.getModel();
    return model.getChipset().typeOf(Chipset.\u00f400000) && model.getType() == DeviceType.if;
  }

  public boolean isMicrosemiSwitch() {
    final Model model = this.getModel();
    return model.getChipset().typeOf(Chipset.o00000) && model.getType() == DeviceType.if;
  }

  public boolean isMediaTekSwitch() {
    final Model model = this.getModel();
    return model.getChipset().typeOf(Chipset.\u00d3O0000) && model.getType() == DeviceType.if;
  }

  public boolean isNephosSwitch() {
    final Model model = this.getModel();
    return model.getChipset().typeOf(Chipset.\u00d5O0000) && model.getType() == DeviceType.if;
  }

  // ...

}
```

To extract the list of models that use one of these chipsets I used the following script (executed as `java --class-path path/to/ace.jar main.java`):

```java
import com.ubnt.data.Model;

class UniFiModels {
  public static void main(String[] args) {
    /*
    for (Model model : Model.values()) {
      System.out.printf(
          "Model = %s\nSKU = %s\nType = %s\nFeatures = %s\nChipset = %s\nSysId = %s\nPortNum = %s\n\n",
          model,
          model.getSku(),
          model.getType(),
          model.getFeatures(),
          model.getChipset(),
          model.getSysId(),
          model.getPortNum());
    }
    */

    for (Model model : Model.values()) {
      System.out.printf("%s: %s (%s)\n", model.getChipset(), model, model.getSku());
    }
  }
}

```

---------

Co-authored-by: Joshua Spence <josh@spence.com.au>
2023-03-08 18:02:34 +11:00
Chris Hasenpflug
8bfcf5b503 firewall_rule: Add enabled attribute (#63)
* firewall_rule: Add enabled attribute

Resolves #62

* Add tests

* Update docs

---------

Co-authored-by: Joshua Spence <josh@spence.com.au>
2023-03-02 20:06:04 +11:00
Joshua Spence
2eba55a7f3 Change default value for allow_adoption (#317)
* Change default value for `allow_adoption`

* Update docs
2023-02-28 22:19:22 +11:00
Joshua Spence
b3662a627f Fix network mDNS acceptance tests (#311)
* Make compatible with `getTestVLAN`

* Run `go generate`
2023-02-25 10:18:49 +11:00
Xabier Larrakoetxea Gallego
dc95eceb2e Add support for mDNS on network resource (#292)
* Add support for mDNS on network resource

Signed-off-by: Xabier Larrakoetxea <me@slok.dev>

* Add mDSN network tests

Signed-off-by: Xabier Larrakoetxea <me@slok.dev>

---------

Signed-off-by: Xabier Larrakoetxea <me@slok.dev>
2023-02-25 10:05:48 +11:00
Bill (William) O'Neill
1a9bac4a09 Add support for local_dns_record (#293) 2022-11-16 10:06:35 -05:00
Oskar
0cf907be5f feat: create users in the build-in radius server (#286)
* feat: account resource with data source

* Adjust docs and validation

* add import test steps

* adjust radius capitalization in docs

Co-authored-by: Paul Tyng <paul@paultyng.net>
2022-10-23 10:12:10 -04:00
Paul Tyng
f653ca03d9 Update schedule support for typed API field (#284)
* Test removing schedule

* Use new schedule API field

* fix attribute name

* Bump go-unifi
2022-10-23 09:00:07 -04:00
Andreas Harter
0604e1deaf Add missing IPv6 properties (#261)
* Add missing WAN IPv6 properties to network resource

* Rename 'ipv6_static_subnet' to 'ipv6_subnet'

According to the go-unifi lib, the name was incorrect

* Improve description and validation of IPv6 properties

* Add missing IPv6 props to network

* Add IPv6 support to firewall rules

* Adjust naming

* ensure unique vlan

* Add vlan ID validation

* fix assertion

* Update docs

* rename attribute

* cleanup imports

* test protocol_v6

* test dhcp_v6_lease

* spelling

* switch protocol back

Co-authored-by: Paul Tyng <paul@paultyng.net>
2022-10-22 12:56:56 -04:00
Oskar
db21ecd760 Adding radius profile resource (#215)
* Adding radius profile resource

* Fix radius profile resource documentation and naming

* Updated doc generation

Co-authored-by: Paul Tyng <paul@paultyng.net>
2022-10-21 15:52:25 -04:00
Oskar
c48063bb19 Enable USG/UDM radius server (#214)
* Enable built-in radius server settings

* Adding documentation

* Update docs with new generator

Co-authored-by: Paul Tyng <paul@paultyng.net>
2022-10-21 15:42:39 -04:00
Paul Tyng
0d4dc04428 unifi_network - default network access bools to true
* Expose InternetAccessEnabled and IntraNetworkAccessEnabled

* Generate docs

* bump go-unifi to v1.27.0

* ammend tf and unifi versions

* fix minrate preference setting in 7.2

* fix

* try some additional tf 1.3 versions  to see why they are failing

* Bump sdk version to fix import test bug

Co-authored-by: Dillon Newell <dillon@newell-labs.ca>
2022-10-20 11:54:03 -04:00
Paul Tyng
d02c97bd55 Updates for controller v7.1 and dependency updates 2022-07-02 22:02:22 -04:00
Paul Tyng
28872f6fa5 Add PMF mode support to unifi_wlan 2021-09-16 09:19:48 -04:00
Paul Tyng
b4bdfce0fa Remove v5 support 2021-09-16 08:56:37 -04:00
Paul Tyng
f6e1e10cce Add unifi_setting_usg
Fixes #183
2021-09-15 09:00:21 -04:00
Paul Tyng
5ed5e82b08 Add support for DHCP relay
Fixes #148
2021-09-13 08:22:01 -04:00
Kurt McAlpine
a0b5f773d5 Add minimum_data_rate_2g and minimum_data_rate_5g fields to unifi_wlan (#159)
* Add minimum_data_rate_2g and minimum_data_rate_5g fields to unifi_wlan

* Update implementation to match api/sdk types

* Fix disabled state

Co-authored-by: Paul Tyng <paul@paultyng.net>
2021-09-10 22:16:21 -04:00
Paul Tyng
ede214c5c5 Add WPA3 support to unifi_wlan
Fixes #154
2021-09-10 15:29:03 -04:00
Paul Tyng
5e428a4605 Fix some linting issues 2021-08-27 09:59:30 -04:00
Kurt McAlpine
49efd78a4c Add uapsd field to unifi_wlan 2021-08-10 10:31:05 -04:00
Kurt McAlpine
7cc962011a Add l2_isolation field to unifi_wlan 2021-07-22 09:43:18 -04:00
Kurt McAlpine
96b039a727 Add ssh keys to unifi_setting_mgmt 2021-07-06 11:10:05 -04:00
Paul Tyng
741d44f0c0 Some minor adjustments to PR 2021-06-01 19:07:59 -04:00
Alan Jenkins
5f4a14e64f DHCPD Boot Server / Filename
Allows setting the DHCPD boot server and filename attributes of Networks
to enable PXE booting.
2021-06-01 19:07:59 -04:00
Kurt McAlpine
f468e4763e Implement unifi_setting_mgmt resource 2021-04-06 12:01:50 -04:00
Paul Tyng
60ff5eca1b Add unifi_dynamic_dns resource
Fixes #126
2021-03-28 14:54:50 -04:00
Paul Tyng
8c315dc5ce Add unifi_static_route
Fixes #42
2021-03-27 20:36:27 -04:00
Paul Tyng
118f612b49 Modify device a little to allow creation, add basic testing 2021-03-27 16:58:23 -04:00
Wojciech Dubiel
513fd29865 Implement static WAN configuration in unifi_network 2021-03-21 16:47:22 -04:00
Joshua Spence
0409579c68 Add wan_dns1 and wan_dns2 (#117) 2021-03-21 16:27:28 -04:00
Lyle Franklin
2694fcb3f5 Support importing networks by name (#113)
- E.g. `terraform import unifi_network.mynetwork name=LAN`
- Bumps cidr prefix in tests to avoid:
    Call to function "cidrsubnet" failed: prefix extension of 4 does not
    accommodate a subnet numbered 18.
2021-03-21 16:17:13 -04:00
wolf-cosmose
051ed9875e Add rudimentary support for resource unifi_device (#112) 2021-03-20 22:38:32 -04:00
Kurt McAlpine
e08c2acdc2 Add no2ghz_oui to unifi_wlan resource 2021-03-08 14:46:33 -05:00
Paul Tyng
2f1537b9a8 Support site import by name/short ID
Fixes #91
2021-03-07 14:30:16 -05:00
Paul Tyng
74e7b8500a Document firewall rule import
Fixes #93
2021-03-07 14:30:16 -05:00
Paul Tyng
d831b3cad9 Fix docs on wan_type
This was mentioned in #107
2021-03-07 14:26:41 -05:00
Paul Tyng
ef56fa5dec Regenerate docs 2021-03-07 11:23:10 -05:00
Kurt McAlpine
198b5b7eba Add wlan_band field to wlan resource 2021-03-07 09:23:53 -05:00
Joshua Spence
fd3c2a37cd Add icmp_typename 2021-03-05 09:52:26 -05:00
Andy Alm
5a170771e3 Added dst_port to the docs 2021-02-25 18:59:11 -05:00
Paul Tyng
9b94816903 Update example for v6 2021-02-22 13:00:39 -05:00
James Toyer
d98513abe9 Fix up docs examples 2021-02-22 12:53:21 -05:00
James Toyer
afc77184a2 Generate docs for port_profile 2021-02-22 12:53:21 -05:00
Paul Tyng
bbabc7bdb6 Bump tfplugindocs 2021-01-11 09:34:46 -05:00
Chris Clonch
afa0ebf2a3 Add site import to docs (#90)
* Add site import to docs
* Add user_group import to docs
2021-01-11 09:31:47 -05:00
Paul Tyng
50ce9e8fbf Bump the doc generator 2020-12-16 14:51:57 -05:00
Kurt McAlpine
bfe4382722 Support importing networks and wlans from other sites 2020-11-03 19:20:26 -05:00