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>
This commit is contained in:
Oskar
2022-10-23 16:12:10 +02:00
committed by GitHub
parent 6f4f1058e4
commit 0cf907be5f
12 changed files with 520 additions and 13 deletions

View File

@@ -0,0 +1,34 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "unifi_account Data Source - terraform-provider-unifi"
subcategory: ""
description: |-
unifi_account data source can be used to retrieve RADIUS user accounts
---
# unifi_account (Data Source)
`unifi_account` data source can be used to retrieve RADIUS user accounts
<!-- schema generated by tfplugindocs -->
## Schema
### Required
- `name` (String) The name of the account to look up
### Optional
- `site` (String) The name of the site the account is associated with.
### Read-Only
- `id` (String) The ID of this account.
- `network_id` (String) ID of the network for this account
- `password` (String, Sensitive) The password of the account.
- `tunnel_medium_type` (Number) See RFC2868 section 3.2
- `tunnel_type` (Number) See RFC2868 section 3.1

View File

@@ -18,7 +18,7 @@ description: |-
### Optional
- `name` (String) The name of the RADIUS profile to look up. Defaults to `Default`.
- `site` (String) The name of the site the radius profile is associated with.
- `site` (String) The name of the site the RADIUS profile is associated with.
### Read-Only

45
docs/resources/account.md Normal file
View File

@@ -0,0 +1,45 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "unifi_account Resource - terraform-provider-unifi"
subcategory: ""
description: |-
unifi_account manages a RADIUS user account
To authenticate devices based on MAC address, use the MAC address as the username and password under client creation.
Convert lowercase letters to uppercase, and also remove colons or periods from the MAC address.
ATTENTION: If the user profile does not include a VLAN, the client will fall back to the untagged VLAN.
NOTE: MAC-based authentication accounts can only be used for wireless and wired clients. L2TP remote access does not apply.
---
# unifi_account (Resource)
`unifi_account` manages a RADIUS user account
To authenticate devices based on MAC address, use the MAC address as the username and password under client creation.
Convert lowercase letters to uppercase, and also remove colons or periods from the MAC address.
ATTENTION: If the user profile does not include a VLAN, the client will fall back to the untagged VLAN.
NOTE: MAC-based authentication accounts can only be used for wireless and wired clients. L2TP remote access does not apply.
<!-- schema generated by tfplugindocs -->
## Schema
### Required
- `name` (String) The name of the account.
- `password` (String, Sensitive) The password of the account.
### Optional
- `network_id` (String) ID of the network for this account
- `site` (String) The name of the site to associate the account with.
- `tunnel_medium_type` (Number) See [RFC 2868](https://www.rfc-editor.org/rfc/rfc2868) section 3.2 Defaults to `6`.
- `tunnel_type` (Number) See [RFC 2868](https://www.rfc-editor.org/rfc/rfc2868) section 3.1 Defaults to `13`.
### Read-Only
- `id` (String) The ID of the account.

View File

@@ -3,12 +3,12 @@
page_title: "unifi_radius_profile Resource - terraform-provider-unifi"
subcategory: ""
description: |-
unifi_radius_profile manages radius profiles.
unifi_radius_profile manages RADIUS profiles.
---
# unifi_radius_profile (Resource)
`unifi_radius_profile` manages radius profiles.
`unifi_radius_profile` manages RADIUS profiles.
@@ -21,14 +21,14 @@ description: |-
### Optional
- `accounting_enabled` (Boolean) Specifies whether to use radius accounting. Defaults to `false`.
- `accounting_enabled` (Boolean) Specifies whether to use RADIUS accounting. Defaults to `false`.
- `acct_server` (Block List) RADIUS accounting servers. (see [below for nested schema](#nestedblock--acct_server))
- `auth_server` (Block List) RADIUS authentication servers. (see [below for nested schema](#nestedblock--auth_server))
- `interim_update_enabled` (Boolean) Specifies whether to use interim_update. Defaults to `false`.
- `interim_update_interval` (Number) Specifies interim_update interval. Defaults to `3600`.
- `site` (String) The name of the site to associate the settings with.
- `use_usg_acct_server` (Boolean) Specifies whether to use usg as a radius accounting server. Defaults to `false`.
- `use_usg_auth_server` (Boolean) Specifies whether to use usg as a radius authentication server. Defaults to `false`.
- `use_usg_acct_server` (Boolean) Specifies whether to use usg as a RADIUS accounting server. Defaults to `false`.
- `use_usg_auth_server` (Boolean) Specifies whether to use usg as a RADIUS authentication server. Defaults to `false`.
- `vlan_enabled` (Boolean) Specifies whether to use vlan on wired connections. Defaults to `false`.
- `vlan_wlan_mode` (String) Specifies whether to use vlan on wireless connections. Must be one of `disabled`, `optional`, or `required`. Defaults to ``.