cli: set constellation uid and role as instance metadata of OpenStack instances (#1311)

This commit is contained in:
Malte Poll 2023-03-01 08:48:17 +01:00 committed by GitHub
parent 8c171a1b66
commit 4e202fa483
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 0 deletions

View File

@ -135,6 +135,7 @@ module "instance_group_control_plane" {
openstack_compute_secgroup_v2.vpc_secgroup.id, openstack_compute_secgroup_v2.vpc_secgroup.id,
] ]
tags = local.tags tags = local.tags
uid = local.uid
disk_size = var.state_disk_size disk_size = var.state_disk_size
availability_zone = var.availability_zone availability_zone = var.availability_zone
network_id = openstack_networking_network_v2.vpc_network.id network_id = openstack_networking_network_v2.vpc_network.id
@ -149,6 +150,7 @@ module "instance_group_worker" {
image_id = openstack_images_image_v2.constellation_os_image.image_id image_id = openstack_images_image_v2.constellation_os_image.image_id
flavor_id = var.flavor_id flavor_id = var.flavor_id
tags = local.tags tags = local.tags
uid = local.uid
security_groups = [ security_groups = [
openstack_compute_secgroup_v2.vpc_secgroup.id, openstack_compute_secgroup_v2.vpc_secgroup.id,
] ]

View File

@ -48,6 +48,8 @@ resource "openstack_compute_instance_v2" "instance_group_member" {
delete_on_termination = true delete_on_termination = true
} }
metadata = { metadata = {
constellation-role = local.role_dashed
constellation-uid = var.uid
constellation-init-secret-hash = var.init_secret_hash constellation-init-secret-hash = var.init_secret_hash
} }
availability_zone_hints = var.availability_zone availability_zone_hints = var.availability_zone

View File

@ -3,6 +3,11 @@ variable "name" {
description = "Base name of the instance group." description = "Base name of the instance group."
} }
variable "uid" {
type = string
description = "Unique ID of the Constellation."
}
variable "role" { variable "role" {
type = string type = string
description = "The role of the instance group." description = "The role of the instance group."