fix: make private IP outputs resilient during partial imports
Some checks failed
Deploy Cluster / Terraform (push) Successful in 3m9s
Deploy Cluster / Ansible (push) Failing after 1m16s

This commit is contained in:
2026-03-01 13:36:57 +00:00
parent 41d0abda16
commit 97084c1581

View File

@@ -10,7 +10,10 @@ output "control_plane_names" {
output "control_plane_private_ips" {
description = "Private IPs of control plane nodes"
value = [for cp in hcloud_server.control_plane : one(cp.network).ip]
value = [
for idx, cp in hcloud_server.control_plane :
try(one(cp.network).ip, cidrhost(var.subnet_cidr, 10 + idx))
]
}
output "primary_control_plane_ip" {
@@ -30,7 +33,10 @@ output "worker_names" {
output "worker_private_ips" {
description = "Private IPs of worker nodes"
value = [for worker in hcloud_server.workers : one(worker.network).ip]
value = [
for idx, worker in hcloud_server.workers :
try(one(worker.network).ip, cidrhost(var.subnet_cidr, 20 + idx))
]
}
output "ssh_private_key_path" {