@@ -26,7 +26,7 @@ ________________________________________________________________________________
26
26
*/
27
27
resource "aci_leaf_profile" "map" {
28
28
depends_on = [aci_leaf_interface_profile . map ]
29
- for_each = { for k , v in local . switch_profiles : k => v if v . node_type != " spine" }
29
+ for_each = { for k , v in local . switch_profiles : k => v if v . node_type != " spine" && v . switch_profile == true }
30
30
description = each. value . description
31
31
name = " ${ local . npfx . leaf . switch_profiles } ${ each . value . name } ${ local . nsfx . leaf . switch_profiles } "
32
32
relation_infra_rs_acc_port_p = [aci_leaf_interface_profile . map [each . key ]. id ]
@@ -48,7 +48,7 @@ resource "aci_leaf_selector" "map" {
48
48
aci_leaf_profile . map ,
49
49
]
50
50
for_each = {
51
- for k , v in local . switch_profiles : k => v if v . node_type != " spine"
51
+ for k , v in local . switch_profiles : k => v if v . node_type != " spine" && v . switch_profile == true
52
52
}
53
53
description = each. value . description
54
54
leaf_profile_dn = aci_leaf_profile. map [each . key ]. id
@@ -61,7 +61,7 @@ resource "aci_node_block" "leaf_profile_blocks" {
61
61
depends_on = [
62
62
aci_leaf_selector . map
63
63
]
64
- for_each = { for k , v in local . switch_profiles : k => v if v . node_type != " spine" }
64
+ for_each = { for k , v in local . switch_profiles : k => v if v . node_type != " spine" && v . switch_profile == true }
65
65
description = each. value . description
66
66
from_ = each. value . node_id
67
67
name = " blk${ each . value . node_id } -${ each . value . node_id } "
@@ -99,7 +99,7 @@ resource "aci_spine_profile" "map" {
99
99
depends_on = [
100
100
aci_spine_interface_profile . map
101
101
]
102
- for_each = { for k , v in local . switch_profiles : k => v if v . node_type == " spine" }
102
+ for_each = { for k , v in local . switch_profiles : k => v if v . node_type == " spine" && v . switch_profile == true }
103
103
description = each. value . description
104
104
name = " ${ local . npfx . spine . switch_profiles } ${ each . value . name } ${ local . nsfx . spine . switch_profiles } "
105
105
relation_infra_rs_sp_acc_port_p = [
@@ -121,7 +121,7 @@ resource "aci_spine_switch_association" "map" {
121
121
depends_on = [
122
122
aci_spine_profile . map ,
123
123
]
124
- for_each = { for k , v in local . switch_profiles : k => v if v . node_type == " spine" }
124
+ for_each = { for k , v in local . switch_profiles : k => v if v . node_type == " spine" && v . switch_profile == true }
125
125
spine_profile_dn = aci_spine_profile. map [each . key ]. id
126
126
description = each. value . description
127
127
name = each. value . name
@@ -144,7 +144,7 @@ resource "aci_rest_managed" "spine_profile_node_blocks" {
144
144
aci_spine_profile . map ,
145
145
aci_spine_switch_association . map
146
146
]
147
- for_each = { for k , v in local . switch_profiles : k => v if v . node_type == " spine" }
147
+ for_each = { for k , v in local . switch_profiles : k => v if v . node_type == " spine" && v . switch_profile == true }
148
148
dn = " ${ aci_spine_profile . map [each . key ]. id } /spines-${ each . value . name } -typ-range/nodeblk-blk${ each . key } -${ each . key } "
149
149
class_name = " infraNodeBlk"
150
150
content = {
@@ -197,7 +197,7 @@ resource "aci_access_port_block" "leaf_port_blocks" {
197
197
aci_leaf_interface_profile . map ,
198
198
aci_access_port_selector . map
199
199
]
200
- for_each = { for k , v in local . interface_selectors : k => v if v . sub_port == " " && v . node_type != " spine" }
200
+ for_each = { for k , v in local . interface_selectors : k => v if v . sub_port == false && v . node_type != " spine" }
201
201
access_port_selector_dn = aci_access_port_selector. map [each . key ]. id
202
202
description = each. value . interface_description
203
203
from_card = each. value . module
@@ -222,7 +222,7 @@ resource "aci_access_sub_port_block" "leaf_port_subblocks" {
222
222
aci_leaf_interface_profile . map ,
223
223
aci_access_port_selector . map
224
224
]
225
- for_each = { for k , v in local . interface_selectors : k => v if v . sub_port != " " && v . node_type != " spine" }
225
+ for_each = { for k , v in local . interface_selectors : k => v if v . sub_port == true && v . node_type != " spine" }
226
226
access_port_selector_dn = aci_access_port_selector. map [each . key ]. id
227
227
description = each. value . interface_description
228
228
from_card = each. value . module
@@ -299,7 +299,7 @@ ________________________________________________________________________________
299
299
*/
300
300
resource "aci_static_node_mgmt_address" "map" {
301
301
depends_on = [aci_rest_managed . fabric_membership ]
302
- for_each = local. static_node_mgmt_addresses
302
+ for_each = { for k , v in local . static_node_mgmt_addresses : k => v if length (v . ipv4_address ) > 0 || length (v . ipv6_address ) > 0 }
303
303
addr = each. value . ipv4_address
304
304
# description = each.value.description
305
305
gw = each. value . ipv4_gateway
0 commit comments