-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathpools_ip.tf
More file actions
69 lines (60 loc) · 1.64 KB
/
Copy pathpools_ip.tf
File metadata and controls
69 lines (60 loc) · 1.64 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
# We only have one IP pool today, but we expect to have more in the future.
# Because of that, we've chosen to create them from a variable and using a
# for_each because it will make it easy to add more pools for things like
# IKS or ICO or IWE when we are ready for them.
variable "ip_pools_map" {
type = map(object({
starting_address = string
block_size = number
netmask = string
gateway_address = string
primary_dns = string
secondary_dns = string
}))
default = {
ucs_inband = {
starting_address = "192.168.1.11"
block_size = 239
netmask = "255.255.255.0"
gateway_address = "192.168.1.1"
primary_dns = "10.0.0.10"
secondary_dns = "10.0.0.20"
}
ucs_outofband = {
starting_address = "192.168.5.11"
block_size = 239
netmask = "255.255.255.0"
gateway_address = "192.168.5.1"
primary_dns = "10.0.0.10"
secondary_dns = "10.0.0.20"
}
}
}
resource "intersight_ippool_pool" "ip_pools" {
for_each = var.ip_pools_map
name = each.key
dynamic "tags" {
for_each = local.tags
content {
key = tags.key
value = tags.value
}
}
organization {
moid = local.organization
}
assignment_order = "sequential"
ip_v4_blocks {
from = each.value.starting_address
size = each.value.block_size
}
ip_v4_config {
gateway = each.value.gateway_address
netmask = each.value.netmask
primary_dns = each.value.primary_dns
secondary_dns = each.value.secondary_dns
}
lifecycle {
ignore_changes = [ip_v4_blocks]
}
}