Skip to content

Commit

Permalink
add a comment
Browse files Browse the repository at this point in the history
  • Loading branch information
aimee-889 committed Nov 7, 2023
1 parent 8aa8a77 commit 425e7ab
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/ionos-cidr-workaround/locals.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
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([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) ]])
node_servers = data.ionoscloud_servers.k8s_nodes[*].servers[*]
# it gets a list of all the nics that are attached to the provided servers and extracts the ips as a list of only the nics, that are conneted via the provided lan
node_lan_ips = flatten([for server_idx, server in local.node_servers : [ for nic in flatten(server[*].nics[*]) : nic.ips if nic.lan == tonumber(var.lan_id) ]])
}

0 comments on commit 425e7ab

Please sign in to comment.