From e86b398d1b59482680eed0dfc952935a729ba39f Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Fri, 19 Jan 2024 11:22:10 +0100 Subject: [PATCH] fix: fix errors on empty vars and cleanup unused vars --- main.tf | 5 ++++- variables.tf | 24 ------------------------ 2 files changed, 4 insertions(+), 25 deletions(-) diff --git a/main.tf b/main.tf index 2879611..e644c05 100644 --- a/main.tf +++ b/main.tf @@ -96,7 +96,10 @@ resource "restapi_object" "ucs_server" { "properties" : { "name" : each.value.name, "a" : concat( - [for k, v in flatten(proxmox_virtual_environment_vm.server[each.value.name].ipv4_addresses) : v if k != index(proxmox_virtual_environment_vm.server[each.value.name].network_interface_names, "lo")], + [ + for k, v in flatten(coalesce(proxmox_virtual_environment_vm.server[each.value.name].ipv4_addresses, [])) : + v if k != try(index(proxmox_virtual_environment_vm.server[each.value.name].network_interface_names, "lo"), -1) + ], ), } }) diff --git a/variables.tf b/variables.tf index fbf1a8a..d7e4d40 100644 --- a/variables.tf +++ b/variables.tf @@ -1,12 +1,4 @@ // Proxmox VE -# variable "pve_api_url" { -# type = string -# } - -# variable "pve_api_token" { -# type = string -# } - variable "pve_ssh_keys" { type = list(string) } @@ -16,27 +8,11 @@ variable "pve_node_name" { } // Cloudflare -variable "cloudflare_api_token" { - type = string -} - variable "cloudflare_zones" { type = any } // Univention -variable "ucs_api_url" { - type = string -} - -variable "ucs_api_username" { - type = string -} - -variable "ucs_api_password" { - type = string -} - variable "ucs_zones" { type = any }