-
Notifications
You must be signed in to change notification settings - Fork 0
/
adapter_configuration.tf
39 lines (39 loc) · 1.48 KB
/
adapter_configuration.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#_________________________________________________________________
#
# Intersight Adapter Configuration Policy
# GUI Location: Policies > Create Policy > Adapter Configuration
#_________________________________________________________________
resource "intersight_adapter_config_policy" "map" {
for_each = local.adapter_configuration
description = coalesce(each.value.description, "${each.value.name} Adapter Configuration Policy.")
name = each.value.name
organization { moid = var.orgs[each.value.org] }
dynamic "settings" {
for_each = { for v in each.value.add_vic_adapter_configuration : v.pci_slot => v }
content {
dce_interface_settings = settings.value.dce_interface_settings
object_type = "adapter.AdapterConfig"
slot_id = settings.value.pci_slot
eth_settings {
lldp_enabled = settings.value.enable_lldp
}
fc_settings {
fip_enabled = settings.value.enable_fip
}
physical_nic_mode_settings {
phy_nic_enabled = settings.value.enable_lldp == false && length(regexall(false, settings.value.enable_fip)
) > 0 && settings.value.enable_port_channel == false ? settings.value.enable_physical_nic_mode : false
}
port_channel_settings {
enabled = settings.value.enable_port_channel
}
}
}
dynamic "tags" {
for_each = { for v in each.value.tags : v.key => v }
content {
key = tags.value.key
value = tags.value.value
}
}
}