File tree Expand file tree Collapse file tree 3 files changed +10
-7
lines changed
environments/skeleton/{{cookiecutter.environment}}/tofu Expand file tree Collapse file tree 3 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,8 @@ locals {
25
25
}
26
26
)
27
27
}
28
+
29
+ baremetal_az = var. availability_zone != null ? var. availability_zone : " nova"
28
30
}
29
31
30
32
resource "openstack_blockstorage_volume_v3" "compute" {
@@ -115,7 +117,7 @@ resource "openstack_compute_instance_v2" "compute_fixed_image" {
115
117
fqdn: ${ local . fqdns [each . key ]}
116
118
EOF
117
119
118
- availability_zone = var. match_ironic_node ? " ${ var . availability_zone } ::${ var . baremetal_nodes [each . key ]} " : null
120
+ availability_zone = var. match_ironic_node ? " ${ local . baremetal_az } ::${ var . baremetal_nodes [each . key ]} " : var . availability_zone
119
121
120
122
lifecycle {
121
123
ignore_changes = [
@@ -170,7 +172,7 @@ resource "openstack_compute_instance_v2" "compute" {
170
172
fqdn: ${ local . fqdns [each . key ]}
171
173
EOF
172
174
173
- availability_zone = var. match_ironic_node ? " ${ var . availability_zone } ::${ var . baremetal_nodes [each . key ]} " : null
175
+ availability_zone = var. match_ironic_node ? " ${ local . baremetal_az } ::${ var . baremetal_nodes [each . key ]} " : var . availability_zone
174
176
175
177
}
176
178
Original file line number Diff line number Diff line change @@ -150,9 +150,8 @@ variable "match_ironic_node" {
150
150
151
151
variable "availability_zone" {
152
152
type = string
153
- description = " Name of availability zone - ignored unless match_ironic_node is true"
154
- default = " nova"
155
- nullable = false
153
+ description = " Name of availability zone. If undefined, defaults to 'nova' if match_ironic_node is true, defered to OpenStack otherwise"
154
+ default = null
156
155
}
157
156
158
157
variable "baremetal_nodes" {
Original file line number Diff line number Diff line change @@ -79,7 +79,8 @@ variable "login" {
79
79
For any networks not specified here the cloud will
80
80
select addresses.
81
81
match_ironic_node: Set true to launch instances on the Ironic node of the same name as each cluster node
82
- availability_zone: Name of availability zone - ignored unless match_ironic_node is true (default: "nova")
82
+ availability_zone: Name of availability zone"Name of availability zone. If undefined, defaults to 'nova'
83
+ if match_ironic_node is true, defered to OpenStack otherwise"
83
84
gateway_ip: Address to add default route via
84
85
nodename_template: Overrides variable cluster_nodename_template
85
86
EOF
@@ -122,7 +123,8 @@ variable "compute" {
122
123
For any networks not specified here the cloud will
123
124
select addresses.
124
125
match_ironic_node: Set true to launch instances on the Ironic node of the same name as each cluster node
125
- availability_zone: Name of availability zone - ignored unless match_ironic_node is true (default: "nova")
126
+ availability_zone: Name of availability zone. "Name of availability zone. If undefined, defaults to 'nova'
127
+ if match_ironic_node is true, defered to OpenStack otherwise"
126
128
gateway_ip: Address to add default route via
127
129
nodename_template: Overrides variable cluster_nodename_template
128
130
You can’t perform that action at this time.
0 commit comments