#
# @param manage_clusters_hba manage clusters' pg_hba.conf using postgres::cluster. Eventually should should be true for every host and we can drop the param
class roles::postgresql::server(
- Boolean $manage_clusters_hba = false,
+ Variant[Boolean,Array[Integer]] $manage_clusters_hba = false,
) {
$clusters = $facts['postgresql_clusters']
$clusters.each |$cluster| {
$version = $cluster['version']
$cluster_name = $cluster['cluster']
$port = $cluster['port']
+
+ if $manage_clusters_hba =~ Boolean {
+ $hba = $manage_clusters_hba
+ } else {
+ $hba = $port in $manage_clusters_hba
+ }
postgres::cluster { "${version}::${cluster_name}":
pg_version => $version,
pg_cluster => $cluster_name,
pg_port => $port,
- manage_hba => $manage_clusters_hba,
+ manage_hba => $hba,
}
}
}