Skip to content

Commit f81d10f

Browse files
authored
Merge pull request #76 from stackhpc/volume-type
Add volume type variable
2 parents 98e8d6d + 1657bd9 commit f81d10f

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

compute_instances.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ resource "openstack_compute_instance_v2" "ansible_control" {
3636
boot_index = 0
3737
destination_type = "volume"
3838
delete_on_termination = true
39+
var.volume_type == "" ? null : var.volume_type
3940
}
4041
}
4142
timeouts {
@@ -67,6 +68,7 @@ resource "openstack_compute_instance_v2" "seed" {
6768
boot_index = 0
6869
destination_type = "volume"
6970
delete_on_termination = true
71+
var.volume_type == "" ? null : var.volume_type
7072
}
7173
}
7274
timeouts {
@@ -94,6 +96,7 @@ resource "openstack_compute_instance_v2" "compute" {
9496
boot_index = 0
9597
destination_type = "volume"
9698
delete_on_termination = true
99+
var.volume_type == "" ? null : var.volume_type
97100
}
98101
}
99102
timeouts {
@@ -120,6 +123,7 @@ resource "openstack_compute_instance_v2" "controller" {
120123
boot_index = 0
121124
destination_type = "volume"
122125
delete_on_termination = true
126+
var.volume_type == "" ? null : var.volume_type
123127
}
124128
}
125129
timeouts {
@@ -147,6 +151,7 @@ resource "openstack_compute_instance_v2" "storage" {
147151
boot_index = 0
148152
destination_type = "volume"
149153
delete_on_termination = true
154+
var.volume_type == "" ? null : var.volume_type
150155
}
151156
}
152157
timeouts {
@@ -172,6 +177,7 @@ resource "openstack_compute_instance_v2" "wazuh_manager" {
172177
boot_index = 0
173178
destination_type = "volume"
174179
delete_on_termination = true
180+
var.volume_type == "" ? null : var.volume_type
175181
}
176182
timeouts {
177183
create = "90m"

leafcloud-rocky-9.tfvars.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,5 @@ infra_vm_disk_size = 100
3636

3737
add_ansible_control_fip = true
3838
ansible_control_fip_pool = "external"
39+
40+
volume_type = ""

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,9 @@ variable "ansible_control_fip_pool" {
129129
type = string
130130
default = ""
131131
}
132+
133+
variable "volume_type" {
134+
description = "Volume type to use for block storage. Set to empty string to use the default volume type."
135+
type = string
136+
default = ""
137+
}

volumes.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ resource "openstack_blockstorage_volume_v3" "volumes" {
22
count = var.storage_count
33
name = format("%s-osd-%02d", var.prefix, count.index + 1)
44
size = 40
5+
var.volume_type == "" ? null : var.volume_type
56
}
67

78
resource "openstack_compute_volume_attach_v2" "attachments" {

0 commit comments

Comments
 (0)