Skip to content

Commit 318fb42

Browse files
committed
allow specifying root volume type
1 parent 9541669 commit 318fb42

File tree

6 files changed

+16
-0
lines changed

6 files changed

+16
-0
lines changed

environments/skeleton/{{cookiecutter.environment}}/tofu/compute.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ module "compute" {
1818
vnic_types = lookup(each.value, "vnic_types", var.vnic_types)
1919
volume_backed_instances = lookup(each.value, "volume_backed_instances", var.volume_backed_instances)
2020
root_volume_size = lookup(each.value, "root_volume_size", var.root_volume_size)
21+
root_volume_type = lookup(each.value, "root_volume_type", var.root_volume_type)
2122
gateway_ip = lookup(each.value, "gateway_ip", var.gateway_ip)
2223
nodename_template = lookup(each.value, "nodename_template", var.cluster_nodename_template)
2324

environments/skeleton/{{cookiecutter.environment}}/tofu/control.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ resource "openstack_compute_instance_v2" "control" {
4848
source_type = "image"
4949
destination_type = var.volume_backed_instances ? "volume" : "local"
5050
volume_size = var.volume_backed_instances ? var.root_volume_size : null
51+
volume_type = var.volume_backed_instances ? var.root_volume_type : null
5152
boot_index = 0
5253
delete_on_termination = true
5354
}

environments/skeleton/{{cookiecutter.environment}}/tofu/login.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ module "login" {
1818
vnic_types = lookup(each.value, "vnic_types", var.vnic_types)
1919
volume_backed_instances = lookup(each.value, "volume_backed_instances", var.volume_backed_instances)
2020
root_volume_size = lookup(each.value, "root_volume_size", var.root_volume_size)
21+
root_volume_type = lookup(each.value, "root_volume_type", var.root_volume_type)
2122
gateway_ip = lookup(each.value, "gateway_ip", var.gateway_ip)
2223
nodename_template = lookup(each.value, "nodename_template", var.cluster_nodename_template)
2324

environments/skeleton/{{cookiecutter.environment}}/tofu/node_group/nodes.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ resource "openstack_compute_instance_v2" "compute_fixed_image" {
8282
source_type = "image"
8383
destination_type = "volume"
8484
volume_size = var.root_volume_size
85+
volume_type = var.root_volume_type
8586
boot_index = 0
8687
delete_on_termination = true
8788
}
@@ -136,6 +137,7 @@ resource "openstack_compute_instance_v2" "compute" {
136137
source_type = "image"
137138
destination_type = "volume"
138139
volume_size = var.root_volume_size
140+
volume_type = var.root_volume_type
139141
boot_index = 0
140142
delete_on_termination = true
141143
}

environments/skeleton/{{cookiecutter.environment}}/tofu/node_group/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ variable "root_volume_size" {
4949
default = 40
5050
}
5151

52+
variable "root_volume_type" {
53+
type = string
54+
default = null
55+
}
56+
5257
variable "extra_volumes" {
5358
description = <<-EOF
5459
Mapping defining additional volumes to create and attach.

environments/skeleton/{{cookiecutter.environment}}/tofu/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,12 @@ variable "root_volume_size" {
228228
default = 40
229229
}
230230

231+
variable "root_volume_type" {
232+
description = "Type of root volume, if using volume backed instances. Default gives default volume type"
233+
type = string
234+
default = null
235+
}
236+
231237
variable "gateway_ip" {
232238
description = "Address to add default route via"
233239
type = string

0 commit comments

Comments
 (0)