} else {
$pg_backup_host = $host["vars"]["real_hostname"][0]
}
+ if has_key($host["vars"], "postgresql_backup_port") {
+ $pg_listen_port = $host["vars"]["postgresql_backup_port"][0]
+ } else {
+ $pg_listen_port = undef
+ }
+
$pg_path = "$mountpoint/$pg_backup_host/postgresql"
$pg_backup_path = "$mountpoint/$pg_backup_host/postgresql_backup"
$pg_host = "$pg_backup_host"
}
if !empty($ldap_filter) and ($pg_infos["pgbouncer"]) {
+ if empty($pg_listen_port) {
+ $pg_listen_port_key = ""
+ } else {
+ $pg_listen_port_key = "port=$pg_listen_port"
+ }
+
concat::fragment { "pgbouncer_$pg_backup_host":
target => "/etc/pgbouncer/pgbouncer.ini",
order => 02,
- content => "${pg_infos[pgbouncer_dbname]} = host=$mountpoint/$pg_backup_host/postgresql user=${pg_infos[dbuser]} dbname=${pg_infos[dbname]}",
+ content => "${pg_infos[pgbouncer_dbname]} = host=$mountpoint/$pg_backup_host/postgresql $pg_listen_port_key user=${pg_infos[dbuser]} dbname=${pg_infos[dbname]}",
}
postgresql::server::pg_hba_rule { "$pg_backup_host - local access as ${pg_infos[dbuser]} user":
+<%- if !@pg_listen_port.nil? -%>
+listen_addresses= '*'
+port = <%= @pg_listen_port %>
+ssl = on
+<%- else -%>
listen_addresses= ''
+<%- end %>
unix_socket_directories = '<%= @pg_path %>'
data_directory = '<%= @pg_path %>'
wal_level = logical
-