Puppet Class: confdroid_postgresql::params

Summary

Class contains all parameters for the confdroid_postgresql module.

Overview

confdroid_postgresql::params.pp Module name: confdroid_postgresql Author: 12ww1160 (12ww1160@confdroid.com)

Parameters:

  • pl_server_fqdn (String) (defaults to: undef)

    the fqdn of the postgresql server. Any other system will be configured as client

  • reqpackages_server (Array) (defaults to: ['postgresql-server','postgresql-contrib'])

    the packages for the server

  • reqpackages_extensions (String) (defaults to: 'timescaledb')

    the packages for extensions

  • reqpackages_client (String) (defaults to: 'postgresql')

    the packages for the client

  • reqpackages_bouncer (String) (defaults to: 'pgbouncer')

    the packages for the bouncer

  • pkg_ensure (String) (defaults to: 'latest')

    which version of the packages to install, i.e. ‘latest’, ‘present’ ‘13.20’,

  • pl_fw_rule_order (String) (defaults to: '50')

    the prefix for the firewall rule

  • pl_fw_port (String) (defaults to: '5432')

    the port to use for service and firewall

  • pl_source_range (String) (defaults to: '0.0.0.0/0')

    the source range for allowed clients

  • pl_enable_fw (Boolean) (defaults to: true)

    whether to enable the firewall

  • pl_listen_address (String) (defaults to: '*')

    which address should the service listen on

  • pl_listen_port (String) (defaults to: '5432')

    which port should the service listen on

  • pl_max_conn (String) (defaults to: '100')

    maximum connections the service will accept

  • pl_ssl_enabled (Boolean) (defaults to: false)

    whether SSL is enabled (true) or disabled (false)

  • pl_server_crt (String) (defaults to: 'server.crt')

    the name of the server cert

  • pl_server_key (String) (defaults to: 'server.key')

    the name of the server key

  • pl_ca_crt (String) (defaults to: 'root.crt')

    the name of the CA crt

  • pl_manage_content (Boolean) (defaults to: true)

    whether to manage roles and databases

  • pl_manage_extensions (Boolean) (defaults to: false)

    whether to manage extensions

  • pl_use_exporter (Boolean) (defaults to: false)

    whether to use the postgresql-exporter

  • pl_install_dir (String) (defaults to: '/opt/postgres-exporter')

    the path for the postgres-exporter files

  • pl_idle_timeout (String) (defaults to: '60000')

    idle_in_transaction_session_timeout

  • pl_use_pg_bouncer (Boolean) (defaults to: false)

    whether to use the pc_bouncer

  • pl_bouncer_listen_addr (String) (defaults to: '0.0.0.0')

    bouncer listen address

  • pl_bouncer_port (String) (defaults to: '6432')

    bouncer listen port

  • pl_bouncer_auth_mode (String) (defaults to: 'md5')

    bouncer auth mode

  • pl_bouncer_auth_users (String) (defaults to: 'placeholder')

    placeholder for users

  • pl_bouncer_pool_mode (String) (defaults to: 'transaction')

    bouncer pool mode

  • pl_bouncer_mx_cl_conn (String) (defaults to: '100')

    bouncer max client connections

  • pl_bouncer_pool_size (String) (defaults to: '20')

    bouncer default pool size



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'manifests/params.pp', line 38

class confdroid_postgresql::params (

  String $pl_server_fqdn    = undef,

  # installation
  Array $reqpackages_server       = ['postgresql-server','postgresql-contrib'],
  String $reqpackages_extensions  = 'timescaledb',
  String $reqpackages_client      = 'postgresql',
  String $reqpackages_bouncer     = 'pgbouncer',
  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',
  String $pl_idle_timeout         = '60000',
  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',

  # 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_mode    = 'md5',
  String $pl_bouncer_auth_users   = 'placeholder',
  String $pl_bouncer_pool_mode    = 'transaction',
  String $pl_bouncer_mx_cl_conn   = '100',
  String $pl_bouncer_pool_size    = '20',

) {
  $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/'
  $pl_bouncer_dir           = '/etc/pgbouncer'

  # files
  $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      = "${pl_bouncer_dir}/pgbouncer.ini"
  $pl_bouncer_ini_erb       = 'confdroid_postgresql/server/bouncer/pgbouncer.ini.erb'
  $pl_bouncer_auth_file     = "${pl_bouncer_dir}/userlist.txt"
  $pl_bouncer_auth_erb      = 'confdroid_postgresql/server/bouncer/bouncer_users.erb'

  # Service
  $pl_service               = 'postgresql'
  $pl_exporter_service      = 'postgres_exporter'
  $pl_bouncer_service       = 'pgbouncer'

  # includes must be last
  include confdroid_postgresql::main::config
}