define profile::postgresql::replication (
- Boolean $handle_role = false,
- Boolean $add_self_role = false,
- Boolean $handle_slot = false,
+ Boolean $handle_role = false,
+ Boolean $handle_config = false,
+ Boolean $add_self_role = false,
+ Boolean $handle_slot = false,
+ Optional[String] $target = undef,
) {
include "profile::postgresql::pam_ldap"
fail("Unable to find host for replication")
}
- ensure_resource("postgresql::server::config_entry", "wal_level", {
- value => "logical",
- })
+ if empty($target) {
+ $pg_version = undef
+ } else {
+ $pg_version = "10"
+ }
$host_infos["ipHostNumber"].each |$ip| {
$infos = split($ip, "/")
}
postgresql::server::pg_hba_rule { "allow TCP access for replication to user $host_cn from $ipaddress/$mask":
- type => 'hostssl',
- database => 'replication',
- user => $host_cn,
- address => "$ipaddress/$mask",
- auth_method => 'pam',
- order => "06-01",
+ type => 'hostssl',
+ database => 'replication',
+ user => $host_cn,
+ address => "$ipaddress/$mask",
+ auth_method => 'pam',
+ order => "06-01",
+ target => $target,
+ postgresql_version => $pg_version,
}
}
+ if $handle_config {
+ ensure_resource("postgresql::server::config_entry", "wal_level", {
+ value => "logical",
+ })
+ }
+
if $handle_role {
postgresql::server::role { $host_cn:
replication => true,