From d3a9edf21c369616f97cf5ad1997c8915371f855 Mon Sep 17 00:00:00 2001 From: Daniel Parks Date: Wed, 20 Sep 2017 22:56:06 -0700 Subject: [PATCH] Sort hosts before writing them to a file The hosts might be generated in a non-deterministic order (e.g. from PuppetDB). If that's the case, then the configuration file they're written to will change every run. This ensures that they are always written consistently and avoids spurious change reports. --- manifests/pe_metric.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/pe_metric.pp b/manifests/pe_metric.pp index c1dc3ed..70b4650 100644 --- a/manifests/pe_metric.pp +++ b/manifests/pe_metric.pp @@ -22,7 +22,7 @@ } $config_hash = { - 'hosts' => $hosts, + 'hosts' => $hosts.sort(), 'metrics_type' => $metrics_type, 'metrics_port' => $metrics_port, 'additional_metrics' => $additional_metrics,