Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default value for allow_adoption #317

Merged
merged 2 commits into from
Feb 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/resources/device.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ resource "unifi_device" "us_24_poe" {

### Optional

- `allow_adoption` (Boolean) Specifies whether this resource should tell the controller to adopt the device on create. Defaults to `false`.
- `allow_adoption` (Boolean) Specifies whether this resource should tell the controller to adopt the device on create. Defaults to `true`.
- `forget_on_destroy` (Boolean) Specifies whether this resource should tell the controller to forget the device on destroy. Defaults to `true`.
- `mac` (String) The MAC address of the device. This can be specified so that the provider can take control of a device (since devices are created through adoption).
- `name` (String) The name of the device.
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/port_forward.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ description: |-
### Optional

- `dst_port` (String) The destination port for the forwarding.
- `enabled` (Boolean, Deprecated) Specifies whether the port forwarding rule is enabled or not. This will attribute will be removed in a future release. Instead of disabling a port forwarding rule you can remove it from your configuration.
- `enabled` (Boolean, Deprecated) Specifies whether the port forwarding rule is enabled or not. Defaults to `true`. This will attribute will be removed in a future release. Instead of disabling a port forwarding rule you can remove it from your configuration.
- `fwd_ip` (String) The IPv4 address to forward traffic to.
- `fwd_port` (String) The port to forward traffic to.
- `log` (Boolean) Specifies whether to log forwarded traffic or not. Defaults to `false`.
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/resource_device.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func resourceDevice() *schema.Resource {
Description: "Specifies whether this resource should tell the controller to adopt the device on create.",
Type: schema.TypeBool,
Optional: true,
Default: false,
Default: true,
},
"forget_on_destroy": {
Description: "Specifies whether this resource should tell the controller to forget the device on destroy.",
Expand Down
9 changes: 0 additions & 9 deletions internal/provider/resource_device_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,6 @@ func testAccDeviceConfig(mac string) string {
return fmt.Sprintf(`
resource "unifi_device" "test" {
mac = %q

allow_adoption = true
forget_on_destroy = true
}
`, mac)
}
Expand All @@ -220,9 +217,6 @@ func testAccDeviceConfig_withName(mac, name string) string {
resource "unifi_device" "test" {
mac = %q
name = %q

allow_adoption = true
forget_on_destroy = true
}
`, mac, name)
}
Expand All @@ -241,9 +235,6 @@ resource "unifi_device" "test" {
number = 2
name = "Port 2"
}

allow_adoption = true
forget_on_destroy = true
}
`, mac)
}
Expand Down