# Puppet Class: postgresql_cd::params

Inherited by:
  postgresql_cd::main::dirs
  postgresql_cd::main::files
  postgresql_cd::main::config
  postgresql_cd::main::install
  postgresql_cd::exporter::dirs
  postgresql_cd::server::initdb
  postgresql_cd::exporter::files
  postgresql_cd::server::service
  postgresql_cd::exporter::service
  postgresql_cd::firewall::iptables
  postgresql_cd::server::pghba::pg_hba

Defined in:
  manifests/params.pp

## Summary

Class contains all parameters for the postgresql_cd module.

## Overview

postgresql_cd::params.pp Module name: postgresql_cd Author: Arne Teuke (arne_teuke@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 (`Array`) (defaults to: `['pg_stat_statements','timescaledb']`) —

  the packages for extensions

- reqpackages_client (`String`) (defaults to: `'postgresql'`) —

  the packages for the client

- 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

    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    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
    # File 'manifests/params.pp', line 28

    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
    }