fix: make private IP outputs resilient during partial imports
This commit is contained in:
@@ -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" {
|
||||
|
||||
Reference in New Issue
Block a user