Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/stackhpc-all-in-one.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ on:
vm_image:
description: Image for the all-in-one VM
type: string
default: CentOS-stream8
default: bb8c0a34-533f-42fb-a49b-3461e677f3f6
vm_interface:
description: Default network interface name
type: string
Expand Down
7 changes: 6 additions & 1 deletion terraform/aio/vm.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,14 @@ variable "aio_vm_subnet" {
type = string
}

locals {
image_is_uuid = length(regexall("^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", var.aio_vm_image)) > 0
}

data "openstack_images_image_v2" "image" {
name = var.aio_vm_image
most_recent = true
count = local.image_is_uuid ? 0 : 1
}

data "openstack_networking_subnet_v2" "network" {
Expand All @@ -52,7 +57,7 @@ resource "openstack_compute_instance_v2" "kayobe-aio" {
}

block_device {
uuid = data.openstack_images_image_v2.image.id
uuid = local.image_is_uuid ? var.aio_vm_image: data.openstack_images_image_v2.image[0].id
source_type = "image"
volume_size = 100
boot_index = 0
Expand Down