diff --git a/deployment/terraform/modules/openstack-cogstack-infra/compute.tf b/deployment/terraform/modules/openstack-cogstack-infra/compute.tf index 9b2b31f..0ab8c89 100644 --- a/deployment/terraform/modules/openstack-cogstack-infra/compute.tf +++ b/deployment/terraform/modules/openstack-cogstack-infra/compute.tf @@ -17,7 +17,7 @@ resource "openstack_compute_instance_v2" "cogstack_ops_compute" { } block_device { - uuid = data.openstack_images_image_v2.ubuntu.id + uuid = each.value.image_uuid == null ? data.openstack_images_image_v2.ubuntu.id : each.value.image_uuid source_type = "image" volume_size = each.value.volume_size boot_index = 0 diff --git a/deployment/terraform/modules/openstack-cogstack-infra/outputs.tf b/deployment/terraform/modules/openstack-cogstack-infra/outputs.tf index 65605c1..57aa040 100644 --- a/deployment/terraform/modules/openstack-cogstack-infra/outputs.tf +++ b/deployment/terraform/modules/openstack-cogstack-infra/outputs.tf @@ -22,7 +22,7 @@ output "compute_keypair" { } output "created_security_group" { - value = openstack_networking_secgroup_v2.cogstack_apps_security_group + value = openstack_networking_secgroup_v2.cogstack_apps_security_group description = "Security group associated to the created hosts" } diff --git a/deployment/terraform/modules/openstack-cogstack-infra/shared-locals.tf b/deployment/terraform/modules/openstack-cogstack-infra/shared-locals.tf index f6ffc63..9106870 100644 --- a/deployment/terraform/modules/openstack-cogstack-infra/shared-locals.tf +++ b/deployment/terraform/modules/openstack-cogstack-infra/shared-locals.tf @@ -1,6 +1,6 @@ locals { - random_prefix = random_id.server.b64_url + random_prefix = random_id.server.b64_url output_file_directory = var.output_file_directory != null ? var.output_file_directory : "${path.root}/.build" } diff --git a/deployment/terraform/modules/openstack-cogstack-infra/variables.tf b/deployment/terraform/modules/openstack-cogstack-infra/variables.tf index ecdddc6..3b0f74d 100644 --- a/deployment/terraform/modules/openstack-cogstack-infra/variables.tf +++ b/deployment/terraform/modules/openstack-cogstack-infra/variables.tf @@ -29,12 +29,14 @@ name = Human readable hostname for this host. is_controller = Must be true for exactly one host. This will run the portainer "controller". All other nodes run the portainer "agent". flavour = The openstack_compute_flavor_v2 for the host volume_size = Size in GB for the disk volume for the node +image_uuid = (Optional) The Openstack image you want to run, to override the default in ubuntu_immage_name EOT type = list(object({ name = string, flavour = optional(string, "2cpu4ram"), volume_size = optional(number, 20), - is_controller = optional(bool, false) + is_controller = optional(bool, false), + image_uuid = optional(string, null) })) default = [ @@ -70,11 +72,11 @@ EOT variable "allowed_security_group_rules" { type = list(object({ - port = number - cidr = string - description = string + port = number + cidr = string + description = string })) - default = [ ] + default = [] description = <