From e0385b0456cbd5f64e5464d0b6a36171ba770ba6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arma=C3=ABl=20Gu=C3=A9neau?= Date: Wed, 20 Nov 2024 13:04:41 +0100 Subject: [PATCH] make the list of IPs sorted and without duplicates for robustness --- cluster/prod/app/email/deploy/email.hcl | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/cluster/prod/app/email/deploy/email.hcl b/cluster/prod/app/email/deploy/email.hcl index 7eea2ea..287cff3 100644 --- a/cluster/prod/app/email/deploy/email.hcl +++ b/cluster/prod/app/email/deploy/email.hcl @@ -383,15 +383,24 @@ job "email" { } template { + # Collect machine IPs from the cluster. + # We use intermediate maps to ensure we get a sorted list with no duplicates, + # so that it is robust wrt. changes in the order of the output of ls or + # addition of new machines in an existing site. + # (scratch.MapValues returns the list of *values* in the map, sorted by *key*) data = <