From 4e202fa48325db4229ff22e31a35630f2414e822 Mon Sep 17 00:00:00 2001 From: Malte Poll <1780588+malt3@users.noreply.github.com> Date: Wed, 1 Mar 2023 08:48:17 +0100 Subject: [PATCH] cli: set constellation uid and role as instance metadata of OpenStack instances (#1311) --- cli/internal/terraform/terraform/openstack/main.tf | 2 ++ .../terraform/openstack/modules/instance_group/main.tf | 2 ++ .../terraform/openstack/modules/instance_group/variables.tf | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/cli/internal/terraform/terraform/openstack/main.tf b/cli/internal/terraform/terraform/openstack/main.tf index 90c610c0d..cfc1ef019 100644 --- a/cli/internal/terraform/terraform/openstack/main.tf +++ b/cli/internal/terraform/terraform/openstack/main.tf @@ -135,6 +135,7 @@ module "instance_group_control_plane" { openstack_compute_secgroup_v2.vpc_secgroup.id, ] tags = local.tags + uid = local.uid disk_size = var.state_disk_size availability_zone = var.availability_zone 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 flavor_id = var.flavor_id tags = local.tags + uid = local.uid security_groups = [ openstack_compute_secgroup_v2.vpc_secgroup.id, ] diff --git a/cli/internal/terraform/terraform/openstack/modules/instance_group/main.tf b/cli/internal/terraform/terraform/openstack/modules/instance_group/main.tf index acbef769f..55fa79d6b 100644 --- a/cli/internal/terraform/terraform/openstack/modules/instance_group/main.tf +++ b/cli/internal/terraform/terraform/openstack/modules/instance_group/main.tf @@ -48,6 +48,8 @@ resource "openstack_compute_instance_v2" "instance_group_member" { delete_on_termination = true } metadata = { + constellation-role = local.role_dashed + constellation-uid = var.uid constellation-init-secret-hash = var.init_secret_hash } availability_zone_hints = var.availability_zone diff --git a/cli/internal/terraform/terraform/openstack/modules/instance_group/variables.tf b/cli/internal/terraform/terraform/openstack/modules/instance_group/variables.tf index 28cd44fb3..3cec69d71 100644 --- a/cli/internal/terraform/terraform/openstack/modules/instance_group/variables.tf +++ b/cli/internal/terraform/terraform/openstack/modules/instance_group/variables.tf @@ -3,6 +3,11 @@ variable "name" { description = "Base name of the instance group." } +variable "uid" { + type = string + description = "Unique ID of the Constellation." +} + variable "role" { type = string description = "The role of the instance group."