3
0

add bouncer

This commit is contained in:
12ww1160
2025-12-05 13:06:10 +01:00
parent 9df1304812
commit c4fcffcb40
20 changed files with 119 additions and 16 deletions

View File

@@ -1,12 +1,13 @@
## confdroid_postgresql::params.pp
# Module name: confdroid_postgresql
# Author: Arne Teuke (arne_teuke@confdroid.com)
# Author: Arne Teuke (12ww1160@confdroid.com)
# @summary Class contains all parameters for the confdroid_postgresql module.
# @param [String] pl_server_fqdn the fqdn of the postgresql server. Any other
# system will be configured as client
# @param [Array] reqpackages_server the packages for the server
# @param [String] reqpackages_extensions the packages for extensions
# @param [String] reqpackages_client the packages for the client
# @param [String] reqpackages_bouncer the packages for the bouncer
# @param [String] pkg_ensure which version of the packages to install, i.e.
# 'latest', 'present' '13.20',
# @param [String] pl_fw_rule_order the prefix for the firewall rule
@@ -26,6 +27,13 @@
# @param [String] pl_install_dir the path for the postgres-exporter files
# @param [String] pl_idle_timeout idle_in_transaction_session_timeout
# @param [Boolean] pl_use_pg_bouncer whether to use the pc_bouncer
# @param [String] pl_bouncer_listen_addr bouncer listen address
# @param [String] pl_bouncer_port bouncer listen port
# @param [String] pl_bouncer_auth_file bouncer auth file
# @param [String] pl_bouncer_auth_mode bouncer auth mode
# @param [String] pl_bouncer_pool_mode bouncer pool mode
# @param [String] pl_bouncer_mx_cl_conn bouncer max client connections
# @param [String] pl_bouncer_pool_size bouncer default pool size
##############################################################################
class confdroid_postgresql::params (
@@ -62,6 +70,13 @@ class confdroid_postgresql::params (
# pg bouncer
Boolean $pl_use_pg_bouncer = false,
String $pl_bouncer_listen_addr = '0.0.0.0',
String $pl_bouncer_port = '6432',
String $pl_bouncer_auth_file = '/etc/pgbouncer/userlist.txt',
String $pl_bouncer_auth_mode = 'md5',
String $pl_bouncer_pool_mode = 'transaction',
String $pl_bouncer_mx_cl_conn = '100',
String $pl_bouncer_pool_size = '20',
) {
$fqdn = $facts['networking']['fqdn']
@@ -76,10 +91,13 @@ class confdroid_postgresql::params (
$pl_pg_hba_conf = "${pl_data_dir}/pg_hba.conf"
$pl_pg_hba_rule_conf = 'confdroid_postgresql/server/pghba/pg_hba_rule.conf.erb'
$pl_pg_hba_conf_erb = 'confdroid_postgresql/server/pghba/pg_hba.conf.erb'
$pl_bouncer_ini_file = '/etc/pgbouncer/pgbouncer.ini',
$pl_bouncer_ini_erb = 'confdroid_postgresql/server/bouncer/pgbouncer.ini.erb'
# Service
$pl_service = 'postgresql'
$pl_exporter_service = 'postgres_exporter'
$pl_bouncer_service = 'pgbouncer'
# includes must be last
include confdroid_postgresql::main::config