3
0
Files
confdroid_postgresql/manifests/params.pp
2025-11-21 16:46:25 +01:00

80 lines
3.4 KiB
Puppet

## postgresql_cd::params.pp
# Module name: postgresql_cd
# Author: Arne Teuke (arne_teuke@confdroid.com)
# @summary Class contains all parameters for the postgresql_cd 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 [Array] reqpackages_extensions the packages for extensions
# @param [String] reqpackages_client the packages for the client
# @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
# @param [String] pl_fw_port the port to use for service and firewall
# @param [String] pl_source_range the source range for allowed clients
# @param [Boolean] pl_enable_fw whether to enable the firewall
# @param [String] pl_listen_address which address should the service listen on
# @param [String] pl_listen_port which port should the service listen on
# @param [String] pl_max_conn maximum connections the service will accept
# @param [Boolean] pl_ssl_enabled whether SSL is enabled (true) or disabled (false)
# @param [String] pl_server_crt the name of the server cert
# @param [String] pl_server_key the name of the server key
# @param [String] pl_ca_crt the name of the CA crt
# @param [Boolean] pl_manage_content whether to manage roles and databases
# @param [Boolean] pl_manage_extensions whether to manage extensions
# @param [Boolean] pl_use_exporter whether to use the postgresql-exporter
# @param [String] pl_install_dir the path for the postgres-exporter files
##############################################################################
class postgresql_cd::params (
String $pl_server_fqdn = undef,
# installation
Array $reqpackages_server = ['postgresql-server','postgresql-contrib'],
Array $reqpackages_extensions = ['pg_stat_statements','timescaledb'],
String $reqpackages_client = 'postgresql',
String $pkg_ensure = 'latest',
# firewall
String $pl_fw_rule_order = '50',
String $pl_fw_port = '5432',
String $pl_source_range = '0.0.0.0/0',
Boolean $pl_enable_fw = true,
# main config
String $pl_listen_address = '*',
String $pl_listen_port = '5432',
String $pl_max_conn = '100',
Boolean $pl_ssl_enabled = false,
String $pl_server_crt = 'server.crt',
String $pl_server_key = 'server.key',
String $pl_ca_crt = 'root.crt',
Boolean $pl_manage_content = true,
Boolean $pl_manage_extensions = false,
#
# postgresql exporter
Boolean $pl_use_exporter = false,
String $pl_install_dir = '/opt/postgres-exporter',
) {
$fqdn = $facts['networking']['fqdn']
$domain = $facts['networking']['domain']
$os_name = $facts['os']['name']
$os_release = $facts['os']['release']['major']
# Directories
$pl_data_dir = '/var/lib/pgsql/data/'
# files
$pl_pg_hba_conf = "${pl_data_dir}/pg_hba.conf"
$pl_pg_hba_rule_conf = 'postgresql_cd/server/pghba/pg_hba_rule.conf.erb'
$pl_pg_hba_conf_erb = 'postgresql_cd/server/pghba/pg_hba.conf.erb'
# Service
$pl_service = 'postgresql'
$pl_exporter_service = 'postgres_exporter'
# includes must be last
include postgresql_cd::main::config
}