-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsd_card.tf
57 lines (57 loc) · 1.93 KB
/
sd_card.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#__________________________________________________________________
#
# Intersight SD Card Policy
# GUI Location: Policies > Create Policy > SD Card
#__________________________________________________________________
resource "intersight_sdcard_policy" "map" {
for_each = local.sd_card
description = coalesce(each.value.description, "${each.value.name} SD Card Policy.")
name = each.value.name
organization { moid = var.orgs[each.value.org] }
dynamic "partitions" {
for_each = { for v in [each.value.enable_os] : v => v if each.value.enable_os == true }
content {
type = "OS"
object_type = "sdcard.Partition"
virtual_drives {
additional_properties = jsonencode({ Name = "Hypervisor" })
enable = each.value.enable_os
object_type = "sdcard.OperatingSystem"
}
}
}
dynamic "partitions" {
for_each = {
for v in [each.value.enable_diagnostics] : v => v if length(regexall(true, each.value.enable_diagnostics)
) > 0 || length(regexall(true, each.value.enable_drivers)) > 0 || length(regexall(true, each.value.enable_huu)
) > 0 || length(regexall(true, each.value.enable_scu)) > 0
}
content {
type = "Utility"
object_type = "sdcard.Partition"
virtual_drives {
enable = each.value.enable_diagnostics
object_type = "sdcard.Diagnostics"
}
virtual_drives {
enable = each.value.enable_drivers
object_type = "sdcard.Drivers"
}
virtual_drives {
enable = each.value.enable_huu
object_type = "sdcard.HostUpgradeUtility"
}
virtual_drives {
enable = each.value.enable_scu
object_type = "sdcard.ServerConfigurationUtility"
}
}
}
dynamic "tags" {
for_each = { for v in each.value.tags : v.key => v }
content {
key = tags.value.key
value = tags.value.value
}
}
}