From: Peter Palfrader Date: Sun, 29 Sep 2019 13:19:25 +0000 (+0200) Subject: we care about the first element of the array X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=7328fcec05bc9192e2387a7b1f46c5ef43cedb6c;p=mirror%2Fdsa-puppet.git we care about the first element of the array --- diff --git a/modules/postgres/manifests/cluster/hba_entry.pp b/modules/postgres/manifests/cluster/hba_entry.pp index 2b6ff6258..b708fa962 100644 --- a/modules/postgres/manifests/cluster/hba_entry.pp +++ b/modules/postgres/manifests/cluster/hba_entry.pp @@ -43,17 +43,19 @@ define postgres::cluster::hba_entry ( if $filtered.length != 1 { fail("Did not find exactly one cluster with port ${pg_port}") } + $cluster = $filtered[0] } elsif $pg_cluster and $pg_version { $filtered = $clusters.filter |$cluster| { $cluster['version'] == $pg_version and $cluster['cluster'] == $pg_cluster} if $filtered.length != 1 { fail("Did not find exactly one cluster ${pg_version}/${pg_cluster}") } + $cluster = $filtered[0] } else { fail('postgres::cluster::hba_entry needs either the port of both a pg version and cluster name') } - $real_port = $filtered['port'] - $real_version = $filtered['version'] - $real_cluster = $filtered['cluster'] + $real_port = $cluster['port'] + $real_version = $cluster['version'] + $real_cluster = $cluster['cluster'] if $pg_version and $pg_version != $real_version { fail("Inconsisten cluster version information: ${pg_version} != ${real_version}") }