Skip to content

Add volume type variable #76

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions compute_instances.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ resource "openstack_compute_instance_v2" "ansible_control" {
boot_index = 0
destination_type = "volume"
delete_on_termination = true
var.volume_type == "" ? null : var.volume_type
}
}
timeouts {
Expand Down Expand Up @@ -67,6 +68,7 @@ resource "openstack_compute_instance_v2" "seed" {
boot_index = 0
destination_type = "volume"
delete_on_termination = true
var.volume_type == "" ? null : var.volume_type
}
}
timeouts {
Expand Down Expand Up @@ -94,6 +96,7 @@ resource "openstack_compute_instance_v2" "compute" {
boot_index = 0
destination_type = "volume"
delete_on_termination = true
var.volume_type == "" ? null : var.volume_type
}
}
timeouts {
Expand All @@ -120,6 +123,7 @@ resource "openstack_compute_instance_v2" "controller" {
boot_index = 0
destination_type = "volume"
delete_on_termination = true
var.volume_type == "" ? null : var.volume_type
}
}
timeouts {
Expand Down Expand Up @@ -147,6 +151,7 @@ resource "openstack_compute_instance_v2" "storage" {
boot_index = 0
destination_type = "volume"
delete_on_termination = true
var.volume_type == "" ? null : var.volume_type
}
}
timeouts {
Expand All @@ -172,6 +177,7 @@ resource "openstack_compute_instance_v2" "wazuh_manager" {
boot_index = 0
destination_type = "volume"
delete_on_termination = true
var.volume_type == "" ? null : var.volume_type
}
timeouts {
create = "90m"
Expand Down
2 changes: 2 additions & 0 deletions leafcloud-rocky-9.tfvars.example
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,5 @@ infra_vm_disk_size = 100

add_ansible_control_fip = true
ansible_control_fip_pool = "external"

volume_type = ""
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,9 @@ variable "ansible_control_fip_pool" {
type = string
default = ""
}

variable "volume_type" {
description = "Volume type to use for block storage. Set to empty string to use the default volume type."
type = string
default = ""
}
1 change: 1 addition & 0 deletions volumes.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ resource "openstack_blockstorage_volume_v3" "volumes" {
count = var.storage_count
name = format("%s-osd-%02d", var.prefix, count.index + 1)
size = 40
var.volume_type == "" ? null : var.volume_type
}

resource "openstack_compute_volume_attach_v2" "attachments" {
Expand Down