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}")
}