Skip to content

Commit

Permalink
change how node_lan_ip is generated - more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
aimee-889 committed Nov 6, 2023
1 parent f821058 commit 8aa8a77
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/ionos-cidr-workaround/locals.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
locals {
nicIndex = index(data.ionoscloud_servers.k8s_node.servers[0].nics.*.lan, tonumber(var.lan_id))
prefix = format("%s/24", data.ionoscloud_servers.k8s_node.servers[0].nics[local.nicIndex].ips[0])
node_lan_ips = flatten(data.ionoscloud_servers.k8s_nodes[*].servers[*].nics[local.nicIndex].ips[0])
node_lan_ips = flatten([for server_idx, server in data.ionoscloud_servers.k8s_nodes[*].servers[*] : [ for nic in flatten(server[*].nics[*]) : nic.ips if nic.lan == tonumber(var.lan_id) ]])
}

0 comments on commit 8aa8a77

Please sign in to comment.