From c40beda61ac82574bb12ae401bc629be3d098712 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wiktor=20Niesiob=C4=99dzki?= Date: Mon, 10 Jun 2024 07:04:20 +0000 Subject: [PATCH] Use deterministic ip_address_names to prevent failures on create or change --- terraform/slurm_cluster/modules/_slurm_instance/main.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/terraform/slurm_cluster/modules/_slurm_instance/main.tf b/terraform/slurm_cluster/modules/_slurm_instance/main.tf index a54650a13..65cb90d05 100644 --- a/terraform/slurm_cluster/modules/_slurm_instance/main.tf +++ b/terraform/slurm_cluster/modules/_slurm_instance/main.tf @@ -60,11 +60,11 @@ locals { for index in range(local.num_instances) : { hostname = local._hostnames[index] network_interfaces = [ - for nic in local._network_interfaces[index] : merge( + for nic_ind, nic in local._network_interfaces[index] : merge( nic, { # generate unique name for ip address name based on hostname and first 16 characters of sha256 of (sub)network id - ip_address_name = "${local._hostnames[index]}-${substr(sha256(coalesce(nic.subnetwork, nic.network)), 0, 16)}" + ip_address_name = "${local._hostnames[index]}-nic${nic_ind}" } ) ]