Skip to content

Commit 7fa8e7c

Browse files
committed
ready for next provider update
1 parent 37c2ced commit 7fa8e7c

10 files changed

+16
-34
lines changed

README.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ A Terraform module to configure Intersight Infrastructure Pools.
1717
| Name | Version |
1818
|------|---------|
1919
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >=1.3.0 |
20-
| <a name="requirement_intersight"></a> [intersight](#requirement\_intersight) | >=1.0.47 |
20+
| <a name="requirement_intersight"></a> [intersight](#requirement\_intersight) | >=1.0.49 |
2121
## Providers
2222

2323
| Name | Version |
2424
|------|---------|
25-
| <a name="provider_intersight"></a> [intersight](#provider\_intersight) | 1.0.47 |
25+
| <a name="provider_intersight"></a> [intersight](#provider\_intersight) | 1.0.49 |
2626
## Modules
2727

2828
No modules.
@@ -38,8 +38,6 @@ No modules.
3838
| Name | Description |
3939
|------|-------------|
4040
| <a name="output_data_pools"></a> [data\_pools](#output\_data\_pools) | Moid's of the Pools that were not defined locally. |
41-
| <a name="output_name_prefix"></a> [name\_prefix](#output\_name\_prefix) | Name Prefix Outputs. |
42-
| <a name="output_name_suffix"></a> [name\_suffix](#output\_name\_suffix) | Name Suffix Outputs. |
4341
| <a name="output_ip"></a> [ip](#output\_ip) | Moids of the IP Pools. |
4442
| <a name="output_iqn"></a> [iqn](#output\_iqn) | Moids of the IQN Pools. |
4543
| <a name="output_mac"></a> [mac](#output\_mac) | Moids of the MAC Pools. |

ip.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ resource "intersight_ippool_reservation" "map" {
7777
dynamic "pool" {
7878
for_each = { for v in [each.value.pool_name] : v => v if each.value.allocation_type == "dynamic" }
7979
content {
80-
moid = contains(local.pools.ip.moids, pool.value) ? intersight_ippool_pool.map[pool.value].moid : local.pools_data["ip"][pool.value].moid
80+
moid = contains(local.pools.ip.moids, pool.value) ? intersight_ippool_pool.map[pool.value].moid : local.pools_data.ip[pool.value].moid
8181
}
8282
}
8383
}

iqn.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ resource "intersight_iqnpool_reservation" "map" {
3939
dynamic "pool" {
4040
for_each = { for v in [each.value.pool_name] : v => v if each.value.allocation_type == "dynamic" }
4141
content {
42-
moid = contains(local.pools.iqn.moids, pool.value) ? intersight_iqnpool_pool.map[pool.value].moid : local.pools_data["iqn"][pool.value].moid
42+
moid = contains(local.pools.iqn.moids, pool.value) ? intersight_iqnpool_pool.map[pool.value].moid : local.pools_data.iqn[pool.value].moid
4343
}
4444
}
4545
}

locals.tf

+6-8
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,12 @@ locals {
7676
#
7777
# Intersight Pool - Reservations
7878
#____________________________________________________________
79-
reservations_loop_1 = flatten([for org in local.org_keys : [
80-
for r in flatten([for v in flatten([for e in lookup(lookup(var.model[org], "profiles", {}), "server", []
81-
) : e.targets if lookup(e, "ignore_reservations", true) == false]) : lookup(v, "reservations", [])]
82-
) : merge(local.defaults.reservations, r, {
83-
org = length(regexall("/", r.pool_name)) > 0 ? element(split("/", r.pool_name), 0) : org
84-
pool_name = length(regexall("/", r.pool_name)) > 0 ? element(split("/", r.pool_name), 1) : r.pool_name
85-
})
86-
]])
79+
reservations_loop_1 = flatten([for org in keys(var.orgs) : [for s in lookup(lookup(lookup(var.model, org, {}), "profiles", {}), "server", []) : [
80+
for t in s.targets : [for r in lookup(t, "reservations", []) : merge(local.defaults.reservations, r, {
81+
org = length(regexall("/", r.pool_name)) > 0 ? element(split("/", r.pool_name), 0) : org
82+
pool_name = length(regexall("/", r.pool_name)) > 0 ? element(split("/", r.pool_name), 1) : r.pool_name
83+
})]] if lookup(s, "ignore_reservations", false) == false]
84+
])
8785
reservations = [for v in local.reservations_loop_1 : merge(v, {
8886
pool_name = "${v.org}/${local.npfx[v.org][v.identity_type]}${v.pool_name}${local.nsfx[v.org][v.identity_type]}"
8987
})]

mac.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ resource "intersight_macpool_reservation" "map" {
3737
dynamic "pool" {
3838
for_each = { for v in [each.value.pool_name] : v => v if each.value.allocation_type == "dynamic" }
3939
content {
40-
moid = contains(local.pools.mac.moids, pool.value) ? intersight_macpool_pool.map[pool.value].moid : local.pools_data["mac"][pool.value].moid
40+
moid = contains(local.pools.mac.moids, pool.value) ? intersight_macpool_pool.map[pool.value].moid : local.pools_data.mac[pool.value].moid
4141
}
4242
}
4343
}

outputs.tf

+1-15
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,6 @@ output "data_pools" {
88
value = { for e in sort(keys(local.pools_data)) : e => { for k, v in local.pools_data[e] : k => v.moid } }
99
}
1010

11-
#__________________________________________________________
12-
#
13-
# Name Prefix/Suffix Outputs
14-
#__________________________________________________________
15-
16-
output "name_prefix" {
17-
description = "Name Prefix Outputs."
18-
value = local.name_prefix
19-
}
20-
output "name_suffix" {
21-
description = "Name Suffix Outputs."
22-
value = local.name_suffix
23-
}
24-
2511
#__________________________________________________________
2612
#
2713
# Pools Outputs
@@ -63,5 +49,5 @@ output "wwpn" {
6349

6450
output "reservations" {
6551
description = "Moids of the Pool Reservations."
66-
value = { for v in local.pool_types : v => local.reservation_results[v] if length(local.reservation_results[v]) > 0 }
52+
value = { for k in keys(local.reservation_results) : k => local.reservation_results[k] if length(local.reservation_results[k]) > 0 }
6753
}

provider.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ terraform {
88
required_providers {
99
intersight = {
1010
source = "CiscoDevNet/intersight"
11-
version = ">=1.0.47"
11+
version = ">=1.0.49"
1212
}
1313
}
1414
required_version = ">=1.3.0"

uuid.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ resource "intersight_uuidpool_reservation" "map" {
3838
dynamic "pool" {
3939
for_each = { for v in [each.value.pool_name] : v => v if each.value.allocation_type == "dynamic" }
4040
content {
41-
moid = contains(local.pools.uuid.moids, pool.value) ? intersight_uuidpool_pool.map[pool.value].moid : local.pools_data["uuid"][pool.value].moid
41+
moid = contains(local.pools.uuid.moids, pool.value) ? intersight_uuidpool_pool.map[pool.value].moid : local.pools_data.uuid[pool.value].moid
4242
}
4343
}
4444
}

wwnn.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ resource "intersight_fcpool_reservation" "wwnn" {
3939
dynamic "pool" {
4040
for_each = { for v in [each.value.pool_name] : v => v if each.value.allocation_type == "dynamic" }
4141
content {
42-
moid = contains(local.pools.wwnn.moids, pool.value) ? intersight_fcpool_pool.wwnn[pool.value].moid : local.pools_data["wwnn"][pool.value].moid
42+
moid = contains(local.pools.wwnn.moids, pool.value) ? intersight_fcpool_pool.wwnn[pool.value].moid : local.pools_data.wwnn[pool.value].moid
4343
}
4444
}
4545
}

wwpn.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ resource "intersight_fcpool_reservation" "wwpn" {
3939
dynamic "pool" {
4040
for_each = { for v in [each.value.pool_name] : v => v if each.value.allocation_type == "dynamic" }
4141
content {
42-
moid = contains(local.pools.wwpn.moids, pool.value) ? intersight_fcpool_pool.wwpn[pool.value].moid : local.pools_data["wwpn"][pool.value].moid
42+
moid = contains(local.pools.wwpn.moids, pool.value) ? intersight_fcpool_pool.wwpn[pool.value].moid : local.pools_data.wwpn[pool.value].moid
4343
}
4444
}
4545
}

0 commit comments

Comments
 (0)