File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed
environments/skeleton/{{cookiecutter.environment}}/tofu Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ module "compute" {
27
27
ignore_image_changes = lookup (each. value , " ignore_image_changes" , false )
28
28
match_ironic_node = lookup (each. value , " match_ironic_node" , false )
29
29
availability_zone = lookup (each. value , " availability_zone" , " nova" )
30
+ use_ironic_node_name = lookup (each. value , " use_ironic_node_name" , false )
30
31
31
32
# computed
32
33
# not using openstack_compute_instance_v2.control.access_ip_v4 to avoid
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ resource "openstack_compute_instance_v2" "compute_fixed_image" {
57
57
58
58
for_each = var. ignore_image_changes ? toset (var. nodes ) : []
59
59
60
- name = " ${ var . cluster_name } -${ each . key } "
60
+ name = var . use_ironic_node_name ? " ${ each . key } " : " ${ var . cluster_name } -${ each . key } "
61
61
image_id = var. image_id
62
62
flavor_name = var. flavor
63
63
key_pair = var. key_pair
@@ -111,7 +111,7 @@ resource "openstack_compute_instance_v2" "compute" {
111
111
112
112
for_each = var. ignore_image_changes ? [] : toset (var. nodes )
113
113
114
- name = " ${ var . cluster_name } -${ each . key } "
114
+ name = var . use_ironic_node_name ? " ${ each . key } " : " ${ var . cluster_name } -${ each . key } "
115
115
image_id = var. image_id
116
116
flavor_name = var. flavor
117
117
key_pair = var. key_pair
Original file line number Diff line number Diff line change @@ -112,6 +112,12 @@ variable "match_ironic_node" {
112
112
default = false
113
113
}
114
114
115
+ variable "use_ironic_node_name" {
116
+ type = bool
117
+ description = " Whether to name instances the same as the matching Ironic node (no cluster name)"
118
+ default = false
119
+ }
120
+
115
121
variable "availability_zone" {
116
122
type = string
117
123
description = " Name of availability zone - ignored unless match_ironic_node is true"
You can’t perform that action at this time.
0 commit comments