2023-12-01 17:49:38 +01:00
|
|
|
# Generic smartgears_service instance
|
2023-12-04 11:01:16 +01:00
|
|
|
|
|
|
|
module "ssh_settings" {
|
|
|
|
source = "../../modules/ssh-key-ref"
|
|
|
|
}
|
|
|
|
|
|
|
|
module "common_variables" {
|
|
|
|
source = "../../modules/common_variables"
|
|
|
|
}
|
|
|
|
|
2023-11-30 16:29:06 +01:00
|
|
|
resource "openstack_compute_instance_v2" "smartgears_service" {
|
|
|
|
for_each = var.smartgears_service_instances_map
|
|
|
|
name = each.value.name
|
2023-12-04 11:01:16 +01:00
|
|
|
availability_zone_hints = module.common_variables.availability_zone_no_gpu_name
|
2023-11-30 16:29:06 +01:00
|
|
|
flavor_name = each.value.flavor
|
|
|
|
key_pair = module.ssh_settings.ssh_key_name
|
|
|
|
security_groups = each.value.security_groups
|
|
|
|
block_device {
|
|
|
|
uuid = each.value.block_device_uuid
|
|
|
|
source_type = "image"
|
|
|
|
volume_size = 10
|
|
|
|
boot_index = 0
|
|
|
|
destination_type = "volume"
|
|
|
|
delete_on_termination = false
|
|
|
|
}
|
|
|
|
|
|
|
|
dynamic "network" {
|
|
|
|
for_each = each.value.networks
|
|
|
|
content {
|
|
|
|
name = network.value
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-12-04 11:01:16 +01:00
|
|
|
user_data = file("${module.common_variables.ubuntu1804_data_file}")
|
2023-11-30 16:29:06 +01:00
|
|
|
}
|