From 9c077553d8d78975ff68aeef34332c5964b603ac Mon Sep 17 00:00:00 2001 From: Philippe Caseiro Date: Fri, 3 Mar 2023 14:59:50 +0100 Subject: [PATCH] fix(nebula): force vms variable type to be safe --- modules/nebula/main.tf | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/modules/nebula/main.tf b/modules/nebula/main.tf index 9882f61..ced9bc6 100644 --- a/modules/nebula/main.tf +++ b/modules/nebula/main.tf @@ -1,5 +1,25 @@ variable "vms" { - type = map + type = map(string,object( + { + domain = string + cpu = number + vcpu = number + ram = number + system_image_persistent = bool + data_image_persistent = bool + data_disks = list(object({ + name = string + size = string + persistent = bool + })) + network_interfaces = list(object({ + network_id = string + ip = string + mac = string + })) + sysdatastore = string + } + )) description = "Virtual Machines description" } @@ -40,7 +60,7 @@ resource "opennebula_image" "system" { name = "system-${each.key}.${each.value.domain}" description = "System disk for ${each.key}" datastore_id = var.one_prod_ds - path = "https://vulcain.cadoles.com/empty_20G" + path = "https://vulcain.cadoles.com/empty_10G" persistent = each.value.system_image_persistent format = var.image_format dev_prefix = var.dev_prefix