terraform: move OpenStack flavorID into nodeGroups

This commit is contained in:
Malte Poll 2023-08-02 10:39:18 +02:00 committed by Malte Poll
parent 3047cb2798
commit d0ec7a3e54
3 changed files with 5 additions and 10 deletions

View file

@ -159,7 +159,6 @@ resource "openstack_compute_secgroup_v2" "vpc_secgroup" {
}
module "instance_group" {
source = "./modules/instance_group"
for_each = var.node_groups
base_name = local.name
@ -170,7 +169,7 @@ module "instance_group" {
state_disk_type = each.value.state_disk_type
availability_zone = each.value.zone
image_id = openstack_images_image_v2.constellation_os_image.image_id
flavor_id = var.flavor_id
flavor_id = each.value.flavor_id
security_groups = [openstack_compute_secgroup_v2.vpc_secgroup.id]
tags = local.tags
uid = local.uid

View file

@ -2,6 +2,7 @@ variable "node_groups" {
type = map(object({
role = string
initial_count = number // number of instances in the node group
flavor_id = string // flavor (machine type) to use for instances
state_disk_size = number // size of state disk (GiB)
state_disk_type = string // type of state disk. Can be 'standard' or 'premium'
zone = string // availability zone
@ -37,11 +38,6 @@ variable "direct_download" {
description = "If enabled, downloads OS image directly from source URL to OpenStack. Otherwise, downloads image to local machine and uploads to OpenStack."
}
variable "flavor_id" {
type = string
description = "The flavor (machine type) to use for cluster nodes."
}
variable "floating_ip_pool_id" {
type = string
description = "The pool (network name) to use for floating IPs."