From cae0a810e2e71c79923d7edadc4f14c00e62ddb4 Mon Sep 17 00:00:00 2001 From: Sebastian Widmer Date: Tue, 29 Oct 2024 12:30:13 +0100 Subject: [PATCH] only output if nodes are adoptable --- outputs.tf | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/outputs.tf b/outputs.tf index e91873b..082a394 100644 --- a/outputs.tf +++ b/outputs.tf @@ -50,29 +50,29 @@ output "master-machineset_yml" { } output "infra-machines_yml" { - value = module.infra.machine_yml + value = var.make_worker_adoptable_by_provider ? module.infra.machine_yml : null } output "infra-machineset_yml" { - value = module.infra.machineset_yml + value = var.make_worker_adoptable_by_provider ? module.infra.machineset_yml : null } output "worker-machines_yml" { - value = module.worker.machine_yml + value = var.make_worker_adoptable_by_provider ? module.worker.machine_yml : null } output "worker-machineset_yml" { - value = module.worker.machineset_yml + value = var.make_worker_adoptable_by_provider ? module.worker.machineset_yml : null } output "additional-worker-machines_yml" { - value = { + value = var.make_worker_adoptable_by_provider ? { "apiVersion" = "v1", "kind" = "List", "items" = flatten(values(module.additional_worker)[*].machines) - } + } : null } output "additional-worker-machinesets_yml" { - value = join("\n---\n", values(module.additional_worker)[*].machineset_yml) + value = var.make_worker_adoptable_by_provider ? join("\n---\n", values(module.additional_worker)[*].machineset_yml) : null }