From a216874980b41e7bd29d1251c18d647e02abc6b3 Mon Sep 17 00:00:00 2001 From: fenix-gitea-admin Date: Wed, 27 Aug 2025 09:08:39 +0000 Subject: [PATCH] Update proxmox.tf --- proxmox.tf | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/proxmox.tf b/proxmox.tf index 677e46c..9efd92a 100644 --- a/proxmox.tf +++ b/proxmox.tf @@ -47,18 +47,25 @@ resource "proxmox_virtual_environment_file" "vm_user_data" { source_raw { file_name = "cloud-init-iac-k8s-${each.key}.yaml" data = yamlencode( - local.deep_merge( - [ - yamldecode(file("${path.module}/cloud-init-base.yaml")), - yamldecode(templatefile("${path.module}/cloud-init-vm.yaml.tftpl", { - extra_packages = try(each.value.extra_packages, []), - extra_users = try(each.value.extra_users, []), - extra_runcmd = try(each.value.extra_runcmd, []), - })) - ] + merge( + yamldecode(file("${path.module}/cloud-init-base.yaml")), + { + packages = concat( + try(yamldecode(file("${path.module}/cloud-init-base.yaml")).packages, []), + try(each.value.extra_packages, []) + ), + users = concat( + try(yamldecode(file("${path.module}/cloud-init-base.yaml")).users, []), + try(each.value.extra_users, []) + ), + runcmd = concat( + try(yamldecode(file("${path.module}/cloud-init-base.yaml")).runcmd, []), + try(each.value.extra_runcmd, []) + ) + } ) ) - } + } locals {