Skip to content

Commit

Permalink
- Adds new fields for unifi network config
Browse files Browse the repository at this point in the history
  • Loading branch information
ivorsmorenburg committed Dec 30, 2021
1 parent 1916002 commit 82cddb0
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 33 deletions.
56 changes: 40 additions & 16 deletions networks_wlans.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,24 @@ resource "unifi_network" "network_configuration" {
vlan_id = each.value.vlan_id
dhcp_start = each.value.dhcp_start
dhcp_stop = each.value.dhcp_stop
dhcpd_boot_enabled = each.value.dhcpd_boot_enabled
dhcpd_boot_filename = each.value.dhcpd_boot_filename
dhcpd_boot_server = each.value.dhcpd_boot_server
igmp_snooping = each.value.igmp_snooping
ipv6_pd_interface = each.value.ipv6_pd_interface
ipv6_pd_prefixid = each.value.ipv6_pd_prefixid
ipv6_ra_enable = each.value.ipv6_ra_enable
ipv6_static_subnet = each.value.ipv6_static_subnet
wan_dns = each.value.wan_dns
wan_gateway = try(each.value.wan_gateway, "0.0.0.0")
wan_ip = each.value.wan_ip
wan_netmask = each.value.wan_netmask
wan_networkgroup = each.value.wan_networkgroup
wan_type = each.value.wan_type
wan_username = each.value.wan_username
x_wan_password = each.value.x_wan_password


domain_name = each.value.domain_name
domain_name = each.value.domain_name
/* ipv6_pd_interface = each.value.ipv6_pd_interface */

dhcp_dns = try(each.value.dhcp_dns, [])
Expand All @@ -30,19 +45,28 @@ resource "unifi_wlan" "wlan_configuration" {
passphrase = each.value.passphrase
security = each.value.security

ap_group_ids = try(each.value.ap_group_ids, [data.unifi_ap_group.default.id])
hide_ssid = each.value.hide_ssid
is_guest = each.value.is_guest
mac_filter_enabled = each.value.mac_filter_enabled
mac_filter_list = each.value.mac_filter_list
mac_filter_policy = each.value.mac_filter_policy
multicast_enhance = each.value.multicast_enhance
network_id = each.value.network_id
no2ghz_oui = each.value.no2ghz_oui
radius_profile_id = each.value.radius_profile_id
ap_group_ids = try(each.value.ap_group_ids, [data.unifi_ap_group.default.id])
hide_ssid = each.value.hide_ssid
is_guest = each.value.is_guest
l2_isolation = try(each.value.l2_isolation, false)
mac_filter_enabled = each.value.mac_filter_enabled
mac_filter_list = each.value.mac_filter_list
mac_filter_policy = each.value.mac_filter_policy
minimum_data_rate_2g_kbps = each.value.minimum_data_rate_2g_kbps
minimum_data_rate_5g_kbps = each.value.minimum_data_rate_5g_kbps
multicast_enhance = each.value.multicast_enhance
network_id = each.value.network_id
no2ghz_oui = each.value.no2ghz_oui
radius_profile_id = each.value.radius_profile_id
/* schedule = each.value.schedule */
site = each.value.site
wlan_band = try(each.value.wlan_bands, "both")

user_group_id = each.value.user_group_id
site = each.value.site
wlan_band = try(each.value.wlan_bands, "both")
# enable WPA2/WPA3 support
wpa3_support = try(each.value.wpa3_support, true)
wpa3_transition = try(each.value.wpa3_transition, true)
pmf_mode = try(each.value.pmf_mode, "optional")

uapsd = try(each.value.uapsd, false)

user_group_id = each.value.user_group_id
}
53 changes: 36 additions & 17 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,22 @@ variable "network_configuration" {
dhcp_start = optional(string)
dhcp_stop = optional(string)
dhcp_dns = optional(set(string))
dhcpd_boot_enabled = optional(bool)
dhcpd_boot_filename = optional(string)
dhcpd_boot_server = optional(string)
igmp_snooping = optional(bool)
ipv6_pd_interface = optional(string)
ipv6_pd_prefixid = optional(string)
ipv6_ra_enable = optional(bool)
ipv6_static_subnet = optional(string)
wan_dns = optional(set(string))
wan_gateway = optional(string)
wan_ip = optional(string)
wan_netmask = optional(string)
wan_networkgroup = optional(string)
wan_type = optional(string)
wan_username = optional(string)
x_wan_password = optional(string)
}))
}

Expand All @@ -52,23 +68,26 @@ variable "wlan_configuration" {
type = map(object({
network_key = optional(string)

ssid = string
security = string
user_group_id = string
passphrase = optional(string)
ap_group_ids = optional(list(string))
hide_ssid = optional(bool)
is_guest = optional(bool)
mac_filter_enabled = optional(bool)
mac_filter_list = optional(list(string))
mac_filter_policy = optional(string)
multicast_enhance = optional(bool)
network_id = optional(string)
no2ghz_oui = bool
radius_profile_id = optional(string)
schedule = optional(string)
site = optional(string)
wlan_band = optional(string)
ssid = string
security = string
user_group_id = string
l2_isolation = optional(bool)
minimum_data_rate_2g_kbps = optional(number)
minimum_data_rate_5g_kbps = optional(number)
passphrase = optional(string)
ap_group_ids = optional(list(string))
hide_ssid = optional(bool)
is_guest = optional(bool)
mac_filter_enabled = optional(bool)
mac_filter_list = optional(list(string))
mac_filter_policy = optional(string)
multicast_enhance = optional(bool)
network_id = optional(string)
no2ghz_oui = bool
radius_profile_id = optional(string)
schedule = optional(string)
site = optional(string)
wlan_band = optional(string)
}))
}

Expand Down

0 comments on commit 82cddb0

Please sign in to comment.