Make variable naming more consistent and more typo fixes
This commit is contained in:
parent
f59ab71fe6
commit
eadff19277
|
@ -28,7 +28,7 @@ resource "openstack_networking_port_v2" "kubecport-sto3" {
|
|||
|
||||
# Boot volume for node
|
||||
resource "openstack_blockstorage_volume_v3" "kubecvolumeboot-sto3" {
|
||||
count = var.workerdcreplicas # Replicas per datacenter
|
||||
count = var.controllerdcreplicas # Replicas per datacenter
|
||||
name = "${var.controller_name}${count.index * local.sto3indexjump + 1 + local.sto3nodenrbase}-${replace(var.dns_suffix,".","-")}-${local.sto3dc}-vol"
|
||||
description = "OS volume for kubernetes worker node ${count.index * local.sto3indexjump + 1 + local.sto3nodenrbase}"
|
||||
size = 100
|
||||
|
@ -85,7 +85,7 @@ resource "openstack_networking_port_v2" "kubewport-sto3" {
|
|||
# Boot volume for node
|
||||
resource "openstack_blockstorage_volume_v3" "kubewvolumeboot-sto3" {
|
||||
count = var.workerdcreplicas # Replicas per datacenter
|
||||
name = "${var.controller_name}${count.index * local.sto3indexjump + 1 + local.sto3nodenrbase}-${replace(var.dns_suffix,".","-")}-${local.sto3dc}-vol"
|
||||
name = "${var.worker_name}${count.index * local.sto3indexjump + 1 + local.sto3nodenrbase}-${replace(var.dns_suffix,".","-")}-${local.sto3dc}-vol"
|
||||
description = "OS volume for kubernetes worker node ${count.index * local.sto3indexjump + 1 + local.sto3nodenrbase}"
|
||||
size = 100
|
||||
image_id = data.openstack_images_image_v2.debian12image-sto3.id
|
||||
|
@ -95,7 +95,7 @@ resource "openstack_blockstorage_volume_v3" "kubewvolumeboot-sto3" {
|
|||
|
||||
resource "openstack_blockstorage_volume_v3" "kubewvolumerook-sto3" {
|
||||
count = var.workerdcreplicas # Replicas per datacenter
|
||||
name = "${var.controller_name}${count.index * local.sto3indexjump + 1 + local.sto3nodenrbase}-${replace(var.dns_suffix,".","-")}-${local.sto3dc}-rook-vol"
|
||||
name = "${var.worker_name}${count.index * local.sto3indexjump + 1 + local.sto3nodenrbase}-${replace(var.dns_suffix,".","-")}-${local.sto3dc}-rook-vol"
|
||||
description = "Rook storage volume for kubernetes worker node ${count.index * local.sto3indexjump + 1 + local.sto3nodenrbase}"
|
||||
size = 100
|
||||
enable_online_resize = true # Allow us to resize volume while attached.
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
# Global definitions for sto4
|
||||
#
|
||||
locals {
|
||||
dc = "sto4"
|
||||
nodenrbase = index(var.datacenters, "sto4")
|
||||
indexjump = length(var.datacenters)
|
||||
sto4dc = "sto4"
|
||||
sto4nodenrbase = index(var.datacenters, "sto4")
|
||||
sto4indexjump = length(var.datacenters)
|
||||
}
|
||||
|
||||
#
|
||||
|
@ -12,7 +12,7 @@ locals {
|
|||
#
|
||||
|
||||
resource "openstack_networking_port_v2" "kubecport-sto4" {
|
||||
name = "${var.controller_name}${count.index * local.indexjump + 1 + local.nodenrbase}-${replace(var.dns_suffix,".","-")}-${local.dc}-port"
|
||||
name = "${var.controller_name}${count.index * local.sto4indexjump + 1 + local.sto4nodenrbase}-${replace(var.dns_suffix,".","-")}-${local.sto4dc}-port"
|
||||
# We create as many ports as there are instances created
|
||||
count = var.controllerdcreplicas
|
||||
network_id = data.openstack_networking_network_v2.public-sto4.id
|
||||
|
@ -27,9 +27,9 @@ resource "openstack_networking_port_v2" "kubecport-sto4" {
|
|||
|
||||
# Boot volume for node
|
||||
resource "openstack_blockstorage_volume_v3" "kubecvolumeboot-sto4" {
|
||||
count = var.workerdcreplicas # Replicas per datacenter
|
||||
name = "${var.controller_name}${count.index * local.indexjump + 1 + local.nodenrbase}-${replace(var.dns_suffix,".","-")}-${local.dc}-vol"
|
||||
description = "OS volume for kubernetes worker node ${count.index * local.indexjump + 1 + local.nodenrbase}"
|
||||
count = var.controllerdcreplicas # Replicas per datacenter
|
||||
name = "${var.controller_name}${count.index * local.sto4indexjump + 1 + local.sto4nodenrbase}-${replace(var.dns_suffix,".","-")}-${local.sto4dc}-vol"
|
||||
description = "OS volume for kubernetes worker node ${count.index * local.sto4indexjump + 1 + local.sto4nodenrbase}"
|
||||
size = 100
|
||||
image_id = data.openstack_images_image_v2.debian12image-sto4.id
|
||||
enable_online_resize = true # Allow us to resize volume while attached.
|
||||
|
@ -38,7 +38,7 @@ resource "openstack_blockstorage_volume_v3" "kubecvolumeboot-sto4" {
|
|||
|
||||
resource "openstack_compute_instance_v2" "controller-nodes-sto4" {
|
||||
count = var.controllerdcreplicas # Replicas per datacenter
|
||||
name = "${var.controller_name}${count.index * local.indexjump + 1 + local.nodenrbase}.${var.dns_suffix}"
|
||||
name = "${var.controller_name}${count.index * local.sto4indexjump + 1 + local.sto4nodenrbase}.${var.dns_suffix}"
|
||||
flavor_name = "${var.controller_instance_type}"
|
||||
key_pair = "${var.keynameworkers}"
|
||||
provider = openstack.sto4
|
||||
|
@ -68,7 +68,7 @@ resource "openstack_compute_instance_v2" "controller-nodes-sto4" {
|
|||
#
|
||||
|
||||
resource "openstack_networking_port_v2" "kubewport-sto4" {
|
||||
name = "${var.worker_name}${count.index * local.indexjump + 1 + local.nodenrbase}-${replace(var.dns_suffix,".","-")}-${local.dc}-port"
|
||||
name = "${var.worker_name}${count.index * local.sto4indexjump + 1 + local.sto4nodenrbase}-${replace(var.dns_suffix,".","-")}-${local.sto4dc}-port"
|
||||
# We create as many ports as there are instances created
|
||||
count = var.workerdcreplicas
|
||||
network_id = data.openstack_networking_network_v2.public-sto4.id
|
||||
|
@ -84,8 +84,8 @@ resource "openstack_networking_port_v2" "kubewport-sto4" {
|
|||
# Boot volume for node
|
||||
resource "openstack_blockstorage_volume_v3" "kubewvolumeboot-sto4" {
|
||||
count = var.workerdcreplicas # Replicas per datacenter
|
||||
name = "${var.controller_name}${count.index * local.indexjump + 1 + local.nodenrbase}-${replace(var.dns_suffix,".","-")}-${local.dc}-vol"
|
||||
description = "OS volume for kubernetes worker node ${count.index * local.indexjump + 1 + local.nodenrbase}"
|
||||
name = "${var.worker_name}${count.index * local.sto4indexjump + 1 + local.sto4nodenrbase}-${replace(var.dns_suffix,".","-")}-${local.sto4dc}-vol"
|
||||
description = "OS volume for kubernetes worker node ${count.index * local.sto4indexjump + 1 + local.sto4nodenrbase}"
|
||||
size = 100
|
||||
image_id = data.openstack_images_image_v2.debian12image-sto4.id
|
||||
enable_online_resize = true # Allow us to resize volume while attached.
|
||||
|
@ -94,8 +94,8 @@ resource "openstack_blockstorage_volume_v3" "kubewvolumeboot-sto4" {
|
|||
|
||||
resource "openstack_blockstorage_volume_v3" "kubewvolumerook-sto4" {
|
||||
count = var.workerdcreplicas # Replicas per datacenter
|
||||
name = "${var.controller_name}${count.index * local.indexjump + 1 + local.nodenrbase}-${replace(var.dns_suffix,".","-")}-${local.dc}-rook-vol"
|
||||
description = "Rook storage volume for kubernetes worker node ${count.index * local.indexjump + 1 + local.nodenrbase}"
|
||||
name = "${var.worker_name}${count.index * local.sto4indexjump + 1 + local.sto4nodenrbase}-${replace(var.dns_suffix,".","-")}-${local.sto4dc}-rook-vol"
|
||||
description = "Rook storage volume for kubernetes worker node ${count.index * local.sto4indexjump + 1 + local.sto4nodenrbase}"
|
||||
size = 100
|
||||
enable_online_resize = true # Allow us to resize volume while attached.
|
||||
provider = openstack.sto4
|
||||
|
@ -103,7 +103,7 @@ resource "openstack_blockstorage_volume_v3" "kubewvolumerook-sto4" {
|
|||
|
||||
resource "openstack_compute_instance_v2" "worker-nodes-sto4" {
|
||||
count = var.workerdcreplicas # Replicas per datacenter
|
||||
name = "${var.worker_name}${count.index * local.indexjump + 1 + local.nodenrbase}.${var.dns_suffix}"
|
||||
name = "${var.worker_name}${count.index * local.sto4indexjump + 1 + local.sto4nodenrbase}.${var.dns_suffix}"
|
||||
flavor_name = "${var.worker_instance_type}"
|
||||
key_pair = "${var.keynameworkers}"
|
||||
provider = openstack.sto4
|
||||
|
|
Loading…
Reference in a new issue