Skip to content

Latest commit

 

History

History
4439 lines (2513 loc) · 142 KB

REFERENCE.md

File metadata and controls

4439 lines (2513 loc) · 142 KB

Reference

Table of Contents

Classes

Public Classes

Private Classes

  • postgresql::backup::pg_dump: "Provider" for pg_dump backup
  • postgresql::dnfmodule: Manage the DNF module
  • postgresql::params
  • postgresql::repo
  • postgresql::repo::apt_postgresql_org
  • postgresql::repo::yum_postgresql_org
  • postgresql::server::config
  • postgresql::server::initdb
  • postgresql::server::install
  • postgresql::server::late_initdb: Manage the default encoding when database initialization is managed by the package
  • postgresql::server::passwd
  • postgresql::server::reload
  • postgresql::server::service

Defined types

Public Defined types

Private Defined types

  • postgresql::server::instance::systemd: This define handles systemd drop-in files for the postgres main instance (default) or additional instances

Resource types

Functions

Public Functions

Private Functions

  • postgresql::postgresql_acls_to_resources_hash: This internal function translates the ipv(4|6)acls format into a resource suitable for create_resources.

Data types

Tasks

  • sql: Allows you to execute arbitary SQL

Classes

postgresql::client

Installs PostgreSQL client software. Set the following parameters if you have a custom version you would like to install.

  • Note Make sure to add any necessary yum or apt repositories if specifying a custom version.

Parameters

The following parameters are available in the postgresql::client class:

file_ensure

Data type: Enum['file', 'absent']

Ensure the connection validation script is present

Default value: 'file'

validcon_script_path

Data type: Stdlib::Absolutepath

Optional. Absolute path for the postgresql connection validation script.

Default value: $postgresql::params::validcon_script_path

package_name

Data type: String[1]

Sets the name of the PostgreSQL client package.

Default value: $postgresql::params::client_package_name

package_ensure

Data type: Variant[Enum['present', 'absent', 'purged', 'disabled', 'installed', 'latest'], String[1]]

Ensure the client package is installed

Default value: 'present'

postgresql::globals

Class for setting cross-class global overrides.

  • Note Most server-specific defaults should be overridden in the postgresql::server class. This class should be used only if you are using a non-standard OS, or if you are changing elements that can only be changed here, such as version or manage_package_repo.

Parameters

The following parameters are available in the postgresql::globals class:

client_package_name

Data type: Optional[String[1]]

Overrides the default PostgreSQL client package name.

Default value: undef

server_package_name

Data type: Optional[String[1]]

Overrides the default PostgreSQL server package name.

Default value: undef

contrib_package_name

Data type: Optional[String[1]]

Overrides the default PostgreSQL contrib package name.

Default value: undef

devel_package_name

Data type: Optional[String[1]]

Overrides the default PostgreSQL devel package name.

Default value: undef

java_package_name

Data type: Optional[String[1]]

Overrides the default PostgreSQL java package name.

Default value: undef

docs_package_name

Data type: Optional[String[1]]

Overrides the default PostgreSQL docs package name.

Default value: undef

perl_package_name

Data type: Optional[String[1]]

Overrides the default PostgreSQL Perl package name.

Default value: undef

plperl_package_name

Data type: Optional[String[1]]

Overrides the default PostgreSQL PL/Perl package name.

Default value: undef

plpython_package_name

Data type: Optional[String[1]]

Overrides the default PostgreSQL PL/Python package name.

Default value: undef

python_package_name

Data type: Optional[String[1]]

Overrides the default PostgreSQL Python package name.

Default value: undef

postgis_package_name

Data type: Optional[String[1]]

Overrides the default PostgreSQL PostGIS package name.

Default value: undef

service_name

Data type: Optional[String[1]]

Overrides the default PostgreSQL service name.

Default value: undef

service_provider

Data type: Optional[String[1]]

Overrides the default PostgreSQL service provider.

Default value: undef

service_status

Data type: Optional[String[1]]

Overrides the default status check command for your PostgreSQL service.

Default value: undef

default_database

Data type: Optional[String[1]]

Specifies the name of the default database to connect with.

Default value: undef

validcon_script_path

Data type: Optional[String[1]]

Scipt path for the connection validation check.

Default value: undef

initdb_path

Data type: Optional[Stdlib::Absolutepath]

Path to the initdb command.

Default value: undef

psql_path

Data type: Optional[Stdlib::Absolutepath]

Sets the path to the psql command.

Default value: undef

pg_hba_conf_path

Data type: Optional[Stdlib::Absolutepath]

Specifies the path to your pg_hba.conf file.

Default value: undef

pg_ident_conf_path

Data type: Optional[Stdlib::Absolutepath]

Specifies the path to your pg_ident.conf file.

Default value: undef

postgresql_conf_path

Data type: Optional[Stdlib::Absolutepath]

Sets the path to your postgresql.conf file.

Default value: undef

postgresql_conf_mode

Data type: Optional[Stdlib::Filemode]

Sets the mode of your postgresql.conf file. Only relevant if manage_postgresql_conf_perms is true.

Default value: undef

recovery_conf_path

Data type: Optional[Stdlib::Absolutepath]

Path to your recovery.conf file.

Default value: undef

default_connect_settings

Data type: Hash

Default connection settings.

Default value: {}

pg_hba_conf_defaults

Data type: Optional[Boolean]

Disables the defaults supplied with the module for pg_hba.conf if set to false.

Default value: undef

datadir

Data type: Optional[String[1]]

Overrides the default PostgreSQL data directory for the target platform. Changing the datadir after installation causes the server to come to a full stop before making the change. For Red Hat systems, the data directory must be labeled appropriately for SELinux. On Ubuntu, you must explicitly set needs_initdb = true to allow Puppet to initialize the database in the new datadir (needs_initdb defaults to true on other systems). Warning! If datadir is changed from the default, Puppet does not manage purging of the original data directory, which causes it to fail if the data directory is changed back to the original

Default value: undef

confdir

Data type: Optional[String[1]]

Overrides the default PostgreSQL configuration directory for the target platform.

Default value: undef

bindir

Data type: Optional[String[1]]

Overrides the default PostgreSQL binaries directory for the target platform.

Default value: undef

xlogdir

Data type: Optional[String[1]]

Overrides the default PostgreSQL xlog directory.

Default value: undef

logdir

Data type: Optional[String[1]]

Overrides the default PostgreSQL log directory.

Default value: undef

log_line_prefix

Data type: Optional[String[1]]

Overrides the default PostgreSQL log prefix.

Default value: undef

user

Data type: Optional[String[1]]

Overrides the default PostgreSQL super user and owner of PostgreSQL related files in the file system.

Default value: undef

group

Data type: Optional[String[1]]

Overrides the default postgres user group to be used for related files in the file system.

Default value: undef

version

Data type: Optional[String[1]]

The version of PostgreSQL to install and manage.

Default value: undef

postgis_version

Data type: Optional[String[1]]

Defines the version of PostGIS to install, if you install PostGIS.

Default value: undef

repo_proxy

Data type: Optional[String[1]]

Sets the proxy option for the official PostgreSQL yum-repositories only.

Default value: undef

repo_baseurl

Data type: Optional[String[1]]

Sets the baseurl for the PostgreSQL repository. Useful if you host your own mirror of the repository.

Default value: undef

yum_repo_commonurl

Data type: Optional[String[1]]

Sets the url for the PostgreSQL common Yum repository. Useful if you host your own mirror of the YUM repository.

Default value: undef

needs_initdb

Data type: Optional[Boolean]

Explicitly calls the initdb operation after the server package is installed and before the PostgreSQL service is started.

Default value: undef

encoding

Data type: Optional[String[1]]

Sets the default encoding for all databases created with this module. On certain operating systems, this is also used during the template1 initialization, so it becomes a default outside of the module as well.

Default value: undef

locale

Data type: Optional[String[1]]

Sets the default database locale for all databases created with this module. On certain operating systems, this is also used during the template1 initialization, so it becomes a default outside of the module as well. On Debian, you'll need to ensure that the 'locales-all' package is installed for full functionality of PostgreSQL.

Default value: undef

data_checksums

Data type: Optional[Boolean]

Use checksums on data pages to help detect corruption by the I/O system that would otherwise be silent. Warning: This option is used during initialization by initdb, and cannot be changed later.

Default value: undef

timezone

Data type: Optional[String[1]]

Sets the default timezone of the postgresql server. The postgresql built-in default is taking the systems timezone information.

Default value: undef

manage_pg_hba_conf

Data type: Optional[Boolean]

Allow Puppet to manage the pg_hba.conf file.

Default value: undef

manage_pg_ident_conf

Data type: Optional[Boolean]

Allow Puppet to manage the pg_ident.conf file.

Default value: undef

manage_recovery_conf

Data type: Optional[Boolean]

Allow Puppet to manage the recovery.conf file.

Default value: undef

manage_postgresql_conf_perms

Data type: Optional[Boolean]

Whether to manage the postgresql conf file permissions. This means owner, group and mode. Contents are not managed but should be managed through postgresql::server::config_entry.

Default value: undef

manage_selinux

Data type: Optional[Boolean]

Allows Puppet to manage the appropriate configuration file for selinux.

Default value: undef

manage_datadir

Data type: Optional[Boolean]

Set to false if you have file{ $datadir: } already defined

Default value: undef

manage_logdir

Data type: Optional[Boolean]

Set to false if you have file{ $logdir: } already defined

Default value: undef

manage_xlogdir

Data type: Optional[Boolean]

Set to false if you have file{ $xlogdir: } already defined

Default value: undef

manage_package_repo

Data type: Optional[Boolean]

Sets up official PostgreSQL repositories on your host if set to true.

Default value: undef

manage_dnf_module

Data type: Boolean

Manage the DNF module. This only makes sense on distributions that use DNF package manager, such as EL8 or Fedora. It also requires Puppet 5.5.20+ or Puppet 6.15.0+ since they ship the dnfmodule provider.

Default value: false

module_workdir

Data type: Optional[String[1]]

Specifies working directory under which the psql command should be executed. May need to specify if '/tmp' is on volume mounted with noexec option.

Default value: undef

postgresql::lib::devel

This class installs postgresql development libraries.

Parameters

The following parameters are available in the postgresql::lib::devel class:

package_name

Data type: String

Override devel package name

Default value: $postgresql::params::devel_package_name

package_ensure

Data type: Variant[Enum['present', 'absent', 'purged', 'disabled', 'installed', 'latest'], String[1]]

Ensure the development libraries are installed

Default value: 'present'

link_pg_config

Data type: Boolean

If the bin directory used by the PostgreSQL page is not /usr/bin or /usr/local/bin, symlinks pg_config from the package's bin dir into usr/bin (not applicable to Debian systems). Set to false to disable this behavior.

Default value: $postgresql::params::link_pg_config

postgresql::lib::docs

Installs PostgreSQL bindings for Postgres-Docs. Set the following parameters if you have a custom version you would like to install.

  • Note Make sure to add any necessary yum or apt repositories if specifying a custom version.

Parameters

The following parameters are available in the postgresql::lib::docs class:

package_name

Data type: String

Specifies the name of the PostgreSQL docs package.

Default value: $postgresql::params::docs_package_name

package_ensure

Data type: Variant[Enum['present', 'absent', 'purged', 'disabled', 'installed', 'latest'], String[1]]

Whether the PostgreSQL docs package resource should be present.

Default value: 'present'

postgresql::lib::java

This class installs the postgresql jdbc connector.

  • Note Make sure to add any necessary yum or apt repositories if specifying a custom version.

Parameters

The following parameters are available in the postgresql::lib::java class:

package_name

Data type: String

Specifies the name of the PostgreSQL java package.

Default value: $postgresql::params::java_package_name

package_ensure

Data type: Variant[Enum['present', 'absent', 'purged', 'disabled', 'installed', 'latest'], String[1]]

Specifies whether the package is present.

Default value: 'present'

postgresql::lib::perl

This class installs the perl libs for postgresql.

Parameters

The following parameters are available in the postgresql::lib::perl class:

package_name

Data type: String

Specifies the name of the PostgreSQL perl package to install.

Default value: $postgresql::params::perl_package_name

package_ensure

Data type: Variant[Enum['present', 'absent', 'purged', 'disabled', 'installed', 'latest'], String[1]]

Ensure the perl libs for postgresql are installed.

Default value: 'present'

postgresql::lib::python

This class installs the python libs for postgresql.

Parameters

The following parameters are available in the postgresql::lib::python class:

package_name

Data type: String[1]

The name of the PostgreSQL Python package.

Default value: $postgresql::params::python_package_name

package_ensure

Data type: Variant[Enum['present', 'absent', 'purged', 'disabled', 'installed', 'latest'], String[1]]

Ensure the python libs for postgresql are installed.

Default value: 'present'

postgresql::server

This installs a PostgreSQL server

Parameters

The following parameters are available in the postgresql::server class:

postgres_password

Data type: Optional[Variant[String[1], Sensitive[String[1]], Integer]]

Sets the password for the postgres user to your specified value. By default, this setting uses the superuser account in the Postgres database, with a user called postgres and no password.

Default value: undef

package_name

Data type: String[1]

Specifies the name of the package to use for installing the server software.

Default value: $postgresql::params::server_package_name

package_ensure

Data type: Variant[Enum['present', 'absent', 'purged', 'disabled', 'installed', 'latest'], String[1]]

Passes a value through to the package resource when creating the server instance.

Default value: $postgresql::params::package_ensure

plperl_package_name

Data type: Optional[String[1]]

Sets the default package name for the PL/Perl extension.

Default value: $postgresql::params::plperl_package_name

plpython_package_name

Data type: Optional[String[1]]

Sets the default package name for the PL/Python extension.

Default value: $postgresql::params::plpython_package_name

service_ensure

Data type: Variant[Enum['running', 'stopped'], Boolean]

Ensure service is installed

Default value: $postgresql::params::service_ensure

service_enable

Data type: Boolean

Enable the PostgreSQL service

Default value: $postgresql::params::service_enable

service_manage

Data type: Boolean

Defines whether or not Puppet should manage the service.

Default value: $postgresql::params::service_manage

service_name

Data type: String[1]

Overrides the default PostgreSQL service name.

Default value: $postgresql::params::service_name

service_restart_on_change

Data type: Boolean

Overrides the default behavior to restart your PostgreSQL service when a config entry has been changed that requires a service restart to become active.

Default value: $postgresql::params::service_restart_on_change

service_provider

Data type: Optional[String[1]]

Overrides the default PostgreSQL service provider.

Default value: $postgresql::params::service_provider

service_reload

Data type: String[1]

Overrides the default reload command for your PostgreSQL service.

Default value: $postgresql::params::service_reload

service_status

Data type: Optional[String[1]]

Overrides the default status check command for your PostgreSQL service.

Default value: $postgresql::params::service_status

default_database

Data type: String[1]

Specifies the name of the default database to connect with. On most systems this is 'postgres'.

Default value: $postgresql::params::default_database

default_connect_settings

Data type: Hash

Specifies a hash of environment variables used when connecting to a remote server. Becomes the default for other defined types, such as postgresql::server::role.

Default value: $postgresql::globals::default_connect_settings

listen_addresses

Data type: Optional[Variant[String[1], Array[String[1]]]]

Address list on which the PostgreSQL service will listen

Default value: $postgresql::params::listen_addresses

port

Data type: Stdlib::Port

Specifies the port for the PostgreSQL server to listen on. Note: The same port number is used for all IP addresses the server listens on. Also, for Red Hat systems and early Debian systems, changing the port causes the server to come to a full stop before being able to make the change. Default value: 5432. Meaning the Postgres server listens on TCP port 5432.

Default value: $postgresql::params::port

ip_mask_deny_postgres_user

Data type: String[1]

Specifies the IP mask from which remote connections should be denied for the postgres superuser. Default value: '0.0.0.0/0', which denies any remote connection.

Default value: $postgresql::params::ip_mask_deny_postgres_user

ip_mask_allow_all_users

Data type: String[1]

Overrides PostgreSQL defaults for remote connections. By default, PostgreSQL does not allow database user accounts to connect via TCP from remote machines. If you'd like to allow this, you can override this setting. Set to '0.0.0.0/0' to allow database users to connect from any remote machine, or '192.168.0.0/1' to allow connections from any machine on your local '192.168' subnet. Default value: '127.0.0.1/32'.

Default value: $postgresql::params::ip_mask_allow_all_users

ipv4acls

Data type: Array[String[1]]

Lists strings for access control for connection method, users, databases, IPv4 addresses;

Default value: $postgresql::params::ipv4acls

ipv6acls

Data type: Array[String[1]]

Lists strings for access control for connection method, users, databases, IPv6 addresses.

Default value: $postgresql::params::ipv6acls

initdb_path

Data type: Stdlib::Absolutepath

Specifies the path to the initdb command.

Default value: $postgresql::params::initdb_path

psql_path

Data type: Stdlib::Absolutepath

Specifies the path to the psql command.

Default value: $postgresql::params::psql_path

pg_hba_conf_path

Data type: Stdlib::Absolutepath

Specifies the path to your pg_hba.conf file.

Default value: $postgresql::params::pg_hba_conf_path

pg_ident_conf_path

Data type: Stdlib::Absolutepath

Specifies the path to your pg_ident.conf file.

Default value: $postgresql::params::pg_ident_conf_path

postgresql_conf_path

Data type: Stdlib::Absolutepath

Specifies the path to your postgresql.conf file.

Default value: $postgresql::params::postgresql_conf_path

postgresql_conf_mode

Data type: Optional[Stdlib::Filemode]

Sets the mode of your postgresql.conf file. Only relevant if manage_postgresql_conf_perms is true.

Default value: $postgresql::params::postgresql_conf_mode

recovery_conf_path

Data type: Stdlib::Absolutepath

Specifies the path to your recovery.conf file.

Default value: $postgresql::params::recovery_conf_path

datadir

Data type: String[1]

PostgreSQL data directory

Default value: $postgresql::params::datadir

xlogdir

Data type: Optional[String[1]]

PostgreSQL xlog directory

Default value: $postgresql::params::xlogdir

logdir

Data type: Optional[String[1]]

PostgreSQL log directory

Default value: $postgresql::params::logdir

log_line_prefix

Data type: Optional[String[1]]

PostgreSQL log line prefix

Default value: $postgresql::params::log_line_prefix

pg_hba_conf_defaults

Data type: Boolean

If false, disables the defaults supplied with the module for pg_hba.conf. This is useful if you disagree with the defaults and wish to override them yourself. Be sure that your changes of course align with the rest of the module, as some access is required to perform basic psql operations for example.

Default value: $postgresql::params::pg_hba_conf_defaults

user

Data type: String[1]

Overrides the default PostgreSQL super user and owner of PostgreSQL related files in the file system.

Default value: $postgresql::params::user

group

Data type: String[1]

Overrides the default postgres user group to be used for related files in the file system.

Default value: $postgresql::params::group

needs_initdb

Data type: Boolean

Explicitly calls the initdb operation after server package is installed, and before the PostgreSQL service is started.

Default value: $postgresql::params::needs_initdb

encoding

Data type: Optional[String[1]]

Sets the default encoding for all databases created with this module. On certain operating systems this is also used during the template1 initialization, so it becomes a default outside of the module as well.

Default value: $postgresql::params::encoding

locale

Data type: Optional[String[1]]

Sets the default database locale for all databases created with this module. On certain operating systems this is used during the template1 initialization as well, so it becomes a default outside of the module.

Default value: $postgresql::params::locale

data_checksums

Data type: Optional[Boolean]

Use checksums on data pages to help detect corruption by the I/O system that would otherwise be silent. Warning: This option is used during initialization by initdb, and cannot be changed later. If set, checksums are calculated for all objects, in all databases.

Default value: $postgresql::params::data_checksums

timezone

Data type: Optional[String[1]]

Set timezone for the PostgreSQL instance

Default value: $postgresql::params::timezone

manage_pg_hba_conf

Data type: Boolean

Boolean. Whether to manage the pg_hba.conf.

Default value: $postgresql::params::manage_pg_hba_conf

manage_pg_ident_conf

Data type: Boolean

Boolean. Overwrites the pg_ident.conf file.

Default value: $postgresql::params::manage_pg_ident_conf

manage_recovery_conf

Data type: Boolean

Boolean. Specifies whether or not manage the recovery.conf.

Default value: $postgresql::params::manage_recovery_conf

manage_postgresql_conf_perms

Data type: Boolean

Whether to manage the postgresql conf file permissions. This means owner, group and mode. Contents are not managed but should be managed through postgresql::server::config_entry.

Default value: $postgresql::params::manage_postgresql_conf_perms

manage_selinux

Data type: Boolean

Specifies whether or not manage the conf file for selinux.

Default value: $postgresql::params::manage_selinux

module_workdir

Data type: String[1]

Working directory for the PostgreSQL module

Default value: $postgresql::params::module_workdir

manage_datadir

Data type: Boolean

Set to false if you have file{ $datadir: } already defined

Default value: $postgresql::params::manage_datadir

manage_logdir

Data type: Boolean

Set to false if you have file{ $logdir: } already defined

Default value: $postgresql::params::manage_logdir

manage_xlogdir

Data type: Boolean

Set to false if you have file{ $xlogdir: } already defined

Default value: $postgresql::params::manage_xlogdir

password_encryption

Data type: Optional[Postgresql::Pg_password_encryption]

Specify the type of encryption set for the password.

Default value: $postgresql::params::password_encryption

roles

Data type: Hash[String, Hash]

Specifies a hash from which to generate postgresql::server::role resources.

Default value: {}

config_entries

Data type: Hash[String, Any]

Specifies a hash from which to generate postgresql::server::config_entry resources.

Default value: {}

pg_hba_rules

Data type: Postgresql::Pg_hba_rules

Specifies a hash from which to generate postgresql::server::pg_hba_rule resources.

Default value: {}

backup_enable

Data type: Boolean

Whether a backup job should be enabled.

Default value: $postgresql::params::backup_enable

backup_options

Data type: Hash

A hash of options that should be passed through to the backup provider.

Default value: {}

backup_provider

Data type: Enum['pg_dump']

Specifies the backup provider to use.

Default value: $postgresql::params::backup_provider

extra_systemd_config

Data type: Optional[String]

Adds extra config to systemd config file, can for instance be used to add extra openfiles. This can be a multi line string

Default value: $postgresql::params::extra_systemd_config

auth_host

Data type: Optional[String[1]]

auth method used by default for host authorization

Default value: undef

auth_local

Data type: Optional[String[1]]

auth method used by default for local authorization

Default value: undef

lc_messages

Data type: Optional[String[1]]

locale used for logging and system messages

Default value: undef

username

Data type: Optional[String[1]]

username of user running the postgres instance

Default value: undef

postgresql::server::contrib

Install the contrib postgresql packaging.

Parameters

The following parameters are available in the postgresql::server::contrib class:

package_name

Data type: Optional[String[1]]

The name of the PostgreSQL contrib package.

Default value: $postgresql::params::contrib_package_name

package_ensure

Data type: Variant[Enum['present', 'absent', 'purged', 'disabled', 'installed', 'latest'], String[1]]

Ensure the contrib package is installed.

Default value: 'present'

postgresql::server::plperl

This class installs the PL/Perl procedural language for postgresql.

Parameters

The following parameters are available in the postgresql::server::plperl class:

package_ensure

Data type: Variant[Enum['present', 'absent', 'purged', 'disabled', 'installed', 'latest'], String[1]]

The ensure parameter passed on to PostgreSQL PL/Perl package resource.

Default value: 'present'

package_name

Data type: Optional[String[1]]

The name of the PostgreSQL PL/Perl package.

Default value: $postgresql::server::plperl_package_name

postgresql::server::plpython

This class installs the PL/Python procedural language for postgresql.

Parameters

The following parameters are available in the postgresql::server::plpython class:

package_ensure

Data type: Variant[Enum['present', 'absent', 'purged', 'disabled', 'installed', 'latest'], String[1]]

Specifies whether the package is present.

Default value: 'present'

package_name

Data type: Optional[String[1]]

Specifies the name of the postgresql PL/Python package.

Default value: $postgresql::server::plpython_package_name

postgresql::server::postgis

Install the postgis postgresql packaging.

Parameters

The following parameters are available in the postgresql::server::postgis class:

package_name

Data type: String

Sets the package name.

Default value: $postgresql::params::postgis_package_name

package_ensure

Data type: Variant[Enum['present', 'absent', 'purged', 'disabled', 'installed', 'latest'], String[1]]

Specifies if the package is present or not.

Default value: 'present'

Defined types

postgresql::server::config_entry

Manage a postgresql.conf entry.

Parameters

The following parameters are available in the postgresql::server::config_entry defined type:

ensure

Data type: Enum['present', 'absent']

Removes an entry if set to 'absent'.

Default value: 'present'

key

Data type: String[1]

Defines the key/name for the setting. Defaults to $name

Default value: $name

value

Data type: Optional[Variant[String[1], Numeric, Array[String[1]]]]

Defines the value for the setting.

Default value: undef

path

Data type: Stdlib::Absolutepath

Path for postgresql.conf

Default value: $postgresql::server::postgresql_conf_path

postgresql::server::database

Define for creating a database.

Parameters

The following parameters are available in the postgresql::server::database defined type:

comment

Data type: Optional[String[1]]

Sets a comment on the database.

Default value: undef

dbname

Data type: String[1]

Sets the name of the database.

Default value: $title

owner

Data type: Optional[String[1]]

Sets name of the database owner.

Default value: undef

tablespace

Data type: Optional[String[1]]

Sets tablespace for where to create this database.

Default value: undef

template

Data type: String[1]

Specifies the name of the template database from which to build this database. Default value: 'template0'.

Default value: 'template0'

encoding

Data type: Optional[String[1]]

Overrides the character set during creation of the database.

Default value: $postgresql::server::encoding

locale

Data type: Optional[String[1]]

Overrides the locale during creation of the database.

Default value: $postgresql::server::locale

istemplate

Data type: Boolean

Defines the database as a template if set to true.

Default value: false

connect_settings

Data type: Hash

Specifies a hash of environment variables used when connecting to a remote server.

Default value: $postgresql::server::default_connect_settings

psql_path

Data type: Stdlib::Absolutepath

Specifies the path to the psql command.

Default value: $postgresql::server::psql_path

default_db

Data type: String[1]

Specifies the name of the default database to connect with. On most systems this is 'postgres'.

Default value: $postgresql::server::default_database

user

Data type: String[1]

Overrides the default PostgreSQL super user and owner of PostgreSQL related files in the file system.

Default value: $postgresql::server::user

group

Data type: String[1]

Overrides the default postgres user group to be used for related files in the file system.

Default value: $postgresql::server::group

port

Data type: Stdlib::Port

Specifies the port for the PostgreSQL server to listen on.

Default value: $postgresql::server::port

postgresql::server::database_grant

Manage a database grant.

Parameters

The following parameters are available in the postgresql::server::database_grant defined type:

privilege

Data type: Enum['ALL', 'CREATE', 'CONNECT', 'TEMPORARY', 'TEMP', 'all', 'create', 'connect', 'temporary', 'temp']

Specifies comma-separated list of privileges to grant. Valid options: 'ALL', 'CREATE', 'CONNECT', 'TEMPORARY', 'TEMP'.

db

Data type: String[1]

Specifies the database to which you are granting access.

role

Data type: String[1]

Specifies the role or user whom you are granting access to.

ensure

Data type: Optional[Enum['present', 'absent']]

Specifies whether to grant or revoke the privilege. Revoke or 'absent' works only in PostgreSQL version 9.1.24 or later.

Default value: undef

psql_db

Data type: Optional[String[1]]

Defines the database to execute the grant against. This should not ordinarily be changed from the default

Default value: undef

psql_user

Data type: String[1]

Specifies the OS user for running psql. Default value: The default user for the module, usually 'postgres'.

Default value: $postgresql::server::user

psql_group

Data type: String[1]

Overrides the default postgres user group to be used for related files in the file system.

Default value: $postgresql::server::group

connect_settings

Data type: Optional[Hash]

Specifies a hash of environment variables used when connecting to a remote server.

Default value: undef

port

Data type: Optional[Stdlib::Port]

Port to use when connecting.

Default value: undef

postgresql::server::db

Define for conveniently creating a role, database and assigning the correct permissions.

Parameters

The following parameters are available in the postgresql::server::db defined type:

user

Data type: String[1]

User to assign access to the database upon creation (will be created if not defined elsewhere). Mandatory.

password

Data type: Optional[Variant[String, Sensitive[String]]]

Sets the password for the created user (if a user is created).

Default value: undef

comment

Data type: Optional[String[1]]

Defines a comment to be stored about the database using the PostgreSQL COMMENT command.

Default value: undef

dbname

Data type: String[1]

Sets the name of the database to be created.

Default value: $title

encoding

Data type: Optional[String[1]]

Overrides the character set during creation of the database.

Default value: $postgresql::server::encoding

locale

Data type: Optional[String[1]]

Overrides the locale during creation of the database.

Default value: $postgresql::server::locale

grant

Data type: Variant[String[1], Array[String[1]]]

Specifies the permissions to grant during creation. Default value: 'ALL'.

Default value: 'ALL'

tablespace

Data type: Optional[String[1]]

Defines the name of the tablespace to allocate the created database to.

Default value: undef

template

Data type: String[1]

Specifies the name of the template database from which to build this database. Defaults value: template0.

Default value: 'template0'

istemplate

Data type: Boolean

Specifies that the database is a template, if set to true.

Default value: false

owner

Data type: Optional[String[1]]

Sets a user as the owner of the database.

Default value: undef

port

Data type: Optional[Stdlib::Port]

Specifies the port where the PostgreSQL server is listening on.

Default value: undef

psql_user

Data type: String[1]

Overrides the default PostgreSQL super user and owner of PostgreSQL related files in the file system.

Default value: $postgresql::server::user

psql_group

Data type: String[1]

Overrides the default PostgreSQL user group to be used for related files in the file system.

Default value: $postgresql::server::group

postgresql::server::default_privileges

Manage a database defaults privileges. Only works with PostgreSQL version 9.6 and above.

Parameters

The following parameters are available in the postgresql::server::default_privileges defined type:

target_role

Data type: Optional[String]

Target role whose created objects will receive the default privileges. Defaults to the current user.

Default value: undef

ensure

Data type: Enum['present', 'absent']

Specifies whether to grant or revoke the privilege.

Default value: 'present'

role

Data type: String

Specifies the role or user whom you are granting access to.

db

Data type: String

Specifies the database to which you are granting access.

object_type

Data type:

Pattern[
    /(?i:^FUNCTIONS$)/,
    /(?i:^ROUTINES$)/,
    /(?i:^SEQUENCES$)/,
    /(?i:^TABLES$)/,
    /(?i:^TYPES$)/,
    /(?i:^SCHEMAS$)/
  ]

Specify target object type: 'FUNCTIONS', 'ROUTINES', 'SEQUENCES', 'TABLES', 'TYPES'.

privilege

Data type: String

Specifies comma-separated list of privileges to grant. Valid options: depends on object type.

schema

Data type: String

Target schema. Defaults to 'public'. Can be set to '' to apply to all schemas.

Default value: 'public'

psql_db

Data type: String

Defines the database to execute the grant against. This should not ordinarily be changed from the default.

Default value: $postgresql::server::default_database

psql_user

Data type: String

Specifies the OS user for running psql. Default value: The default user for the module, usually 'postgres'.

Default value: $postgresql::server::user

psql_path

Data type: Stdlib::Absolutepath

Specifies the OS user for running psql. Default value: The default user for the module, usually 'postgres'.

Default value: $postgresql::server::psql_path

port

Data type: Stdlib::Port

Specifies the port to access the server. Default value: The default user for the module, usually '5432'.

Default value: $postgresql::server::port

connect_settings

Data type: Hash

Specifies a hash of environment variables used when connecting to a remote server.

Default value: $postgresql::server::default_connect_settings

group

Data type: String

Specifies the user group to which the privileges will be granted.

Default value: $postgresql::server::group

postgresql::server::extension

Activate an extension on a postgresql database.

Parameters

The following parameters are available in the postgresql::server::extension defined type:

database

Data type: String[1]

Specifies the database on which to activate the extension.

extension

Data type: String[1]

Specifies the extension to activate. If left blank, uses the name of the resource.

Default value: $name

schema

Data type: Optional[String[1]]

Specifies the schema on which to activate the extension.

Default value: undef

version

Data type: Optional[String[1]]

Specifies the version of the extension which the database uses. When an extension package is updated, this does not automatically change the effective version in each database. This needs be updated using the PostgreSQL-specific SQL ALTER EXTENSION... version may be set to latest, in which case the SQL ALTER EXTENSION "extension" UPDATE is applied to this database (only). version may be set to a specific version, in which case the extension is updated using ALTER EXTENSION "extension" UPDATE TO 'version' eg. If extension is set to postgis and version is set to 2.3.3, this will apply the SQL ALTER EXTENSION "postgis" UPDATE TO '2.3.3' to this database only. version may be omitted, in which case no ALTER EXTENSION... SQL is applied, and the version will be left unchanged.

Default value: undef

ensure

Data type: Enum['present', 'absent']

Specifies whether to activate or deactivate the extension. Valid options: 'present' or 'absent'.

Default value: 'present'

package_name

Data type: Optional[String[1]]

Specifies a package to install prior to activating the extension.

Default value: undef

package_ensure

Data type: Optional[Variant[Enum['present', 'absent', 'purged', 'disabled', 'installed', 'latest'], String[1]]]

Overrides default package deletion behavior. By default, the package specified with package_name is installed when the extension is activated and removed when the extension is deactivated. To override this behavior, set the ensure value for the package.

Default value: undef

port

Data type: Optional[Stdlib::Port]

Port to use when connecting.

Default value: undef

connect_settings

Data type: Hash

Specifies a hash of environment variables used when connecting to a remote server.

Default value: postgresql::default('default_connect_settings')

database_resource_name

Data type: String[1]

Specifies the resource name of the DB being managed. Defaults to the parameter $database, if left blank.

Default value: $database

psql_path

Data type: Stdlib::Absolutepath

Specifies the path to the psql command.

Default value: postgresql::default('psql_path')

user

Data type: String[1]

Overrides the default PostgreSQL super user and owner of PostgreSQL related files in the file system.

Default value: postgresql::default('user')

group

Data type: String[1]

Overrides the default postgres user group to be used for related files in the file system.

Default value: postgresql::default('group')

postgresql::server::grant

Define for granting permissions to roles.

Parameters

The following parameters are available in the postgresql::server::grant defined type:

role

Data type: String

Specifies the role or user whom you are granting access to.

db

Data type: String

Specifies the database to which you are granting access.

privilege

Data type: String

Specifies the privilege to grant. Valid options: 'ALL', 'ALL PRIVILEGES' or 'object_type' dependent string.

Default value: ''

object_type

Data type:

Pattern[#/(?i:^COLUMN$)/,
    /(?i:^ALL SEQUENCES IN SCHEMA$)/,
    /(?i:^ALL TABLES IN SCHEMA$)/,
    /(?i:^DATABASE$)/,
    #/(?i:^FOREIGN DATA WRAPPER$)/,
    #/(?i:^FOREIGN SERVER$)/,
    /(?i:^FUNCTION$)/,
    /(?i:^LANGUAGE$)/,
    #/(?i:^PROCEDURAL LANGUAGE$)/,
    /(?i:^TABLE$)/,
    #/(?i:^TABLESPACE$)/,
    /(?i:^SCHEMA$)/,
    /(?i:^SEQUENCE$)/
    #/(?i:^VIEW$)/
  ]

Specifies the type of object to which you are granting privileges. Valid options: 'DATABASE', 'SCHEMA', 'SEQUENCE', 'ALL SEQUENCES IN SCHEMA', 'TABLE' or 'ALL TABLES IN SCHEMA'.

Default value: 'database'

object_name

Data type: Optional[Variant[Array[String,2,2],String[1]]]

Specifies name of object_type to which to grant access, can be either a string or a two element array. String: 'object_name' Array: ['schema_name', 'object_name']

Default value: undef

object_arguments

Data type: Array[String[1],0]

Specifies any arguments to be passed alongisde the access grant.

Default value: []

psql_db

Data type: String

Specifies the database to execute the grant against. This should not ordinarily be changed from the default

Default value: $postgresql::server::default_database

psql_user

Data type: String

Sets the OS user to run psql.

Default value: $postgresql::server::user

port

Data type: Optional[Stdlib::Port]

Port to use when connecting.

Default value: undef

onlyif_exists

Data type: Boolean

Create grant only if doesn't exist

Default value: false

connect_settings

Data type: Hash

Specifies a hash of environment variables used when connecting to a remote server.

Default value: $postgresql::server::default_connect_settings

ensure

Data type: Enum['present', 'absent']

Specifies whether to grant or revoke the privilege. Default is to grant the privilege. Valid values: 'present', 'absent'.

Default value: 'present'

group

Data type: String

Sets the OS group to run psql

Default value: $postgresql::server::group

psql_path

Data type: Stdlib::Absolutepath

Sets the path to psql command

Default value: $postgresql::server::psql_path

postgresql::server::grant_role

Define for granting membership to a role.

Parameters

The following parameters are available in the postgresql::server::grant_role defined type:

group

Data type: String[1]

Specifies the group role to which you are assigning a role.

role

Data type: String[1]

Specifies the role you want to assign to a group. If left blank, uses the name of the resource.

Default value: $name

ensure

Data type: Enum['present', 'absent']

Specifies whether to grant or revoke the membership. Valid options: 'present' or 'absent'.

Default value: 'present'

psql_db

Data type: String[1]

Specifies the database to execute the grant against. This should not ordinarily be changed from the default

Default value: $postgresql::server::default_database

psql_user

Data type: String[1]

Sets the OS user to run psql.

Default value: $postgresql::server::user

port

Data type: Stdlib::Port

Port to use when connecting.

Default value: $postgresql::server::port

connect_settings

Data type: Hash

Specifies a hash of environment variables used when connecting to a remote server.

Default value: $postgresql::server::default_connect_settings

postgresql::server::instance::config

Manages the config for a postgresql::server instance

Parameters

The following parameters are available in the postgresql::server::instance::config defined type:

ip_mask_deny_postgres_user

Data type: String[1]

Specifies the IP mask from which remote connections should be denied for the postgres superuser. Default value: '0.0.0.0/0', which denies any remote connection.

Default value: $postgresql::server::ip_mask_deny_postgres_user

ip_mask_allow_all_users

Data type: String[1]

Overrides PostgreSQL defaults for remote connections. By default, PostgreSQL does not allow database user accounts to connect via TCP from remote machines. If you'd like to allow this, you can override this setting. Set to '0.0.0.0/0' to allow database users to connect from any remote machine, or '192.168.0.0/1' to allow connections from any machine on your local '192.168' subnet. Default value: '127.0.0.1/32'.

Default value: $postgresql::server::ip_mask_allow_all_users

listen_addresses

Data type: Optional[Variant[String[1], Array[String[1]]]]

Address list on which the PostgreSQL service will listen

Default value: $postgresql::server::listen_addresses

port

Data type: Stdlib::Port

Specifies the port for the PostgreSQL server to listen on. Note: The same port number is used for all IP addresses the server listens on. Also, for Red Hat systems and early Debian systems, changing the port causes the server to come to a full stop before being able to make the change. Default value: 5432. Meaning the Postgres server listens on TCP port 5432.

Default value: $postgresql::server::port

ipv4acls

Data type: Array[String[1]]

Lists strings for access control for connection method, users, databases, IPv4 addresses.

Default value: $postgresql::server::ipv4acls

ipv6acls

Data type: Array[String[1]]

Lists strings for access control for connection method, users, databases, IPv6 addresses.

Default value: $postgresql::server::ipv6acls

pg_hba_conf_path

Data type: Stdlib::Absolutepath

Specifies the path to your pg_hba.conf file.

Default value: $postgresql::server::pg_hba_conf_path

pg_ident_conf_path

Data type: Stdlib::Absolutepath

Specifies the path to your pg_ident.conf file.

Default value: $postgresql::server::pg_ident_conf_path

postgresql_conf_path

Data type: Stdlib::Absolutepath

Specifies the path to your postgresql.conf file.

Default value: $postgresql::server::postgresql_conf_path

postgresql_conf_mode

Data type: Optional[Stdlib::Filemode]

Sets the mode of your postgresql.conf file. Only relevant if manage_postgresql_conf_perms is true.

Default value: $postgresql::server::postgresql_conf_mode

recovery_conf_path

Data type: Stdlib::Absolutepath

Specifies the path to your recovery.conf file.

Default value: $postgresql::server::recovery_conf_path

pg_hba_conf_defaults

Data type: Boolean

If false, disables the defaults supplied with the module for pg_hba.conf. This is useful if you disagree with the defaults and wish to override them yourself. Be sure that your changes of course align with the rest of the module, as some access is required to perform basic psql operations for example.

Default value: $postgresql::server::pg_hba_conf_defaults

user

Data type: String[1]

Overrides the default PostgreSQL super user and owner of PostgreSQL related files in the file system.

Default value: $postgresql::server::user

group

Data type: String[1]

Overrides the default postgres user group to be used for related files in the file system.

Default value: $postgresql::server::group

version

Data type: Optional[String[1]]

Sets PostgreSQL version

Default value: $postgresql::server::_version

manage_pg_hba_conf

Data type: Boolean

Boolean. Whether to manage the pg_hba.conf.

Default value: $postgresql::server::manage_pg_hba_conf

manage_pg_ident_conf

Data type: Boolean

Boolean. Overwrites the pg_ident.conf file.

Default value: $postgresql::server::manage_pg_ident_conf

manage_recovery_conf

Data type: Boolean

Boolean. Specifies whether or not manage the recovery.conf.

Default value: $postgresql::server::manage_recovery_conf

manage_postgresql_conf_perms

Data type: Boolean

Whether to manage the postgresql conf file permissions. This means owner, group and mode. Contents are not managed but should be managed through postgresql::server::config_entry.

Default value: $postgresql::server::manage_postgresql_conf_perms

datadir

Data type: String[1]

PostgreSQL data directory

Default value: $postgresql::server::datadir

logdir

Data type: Optional[String[1]]

PostgreSQL log directory

Default value: $postgresql::server::logdir

service_name

Data type: String[1]

Overrides the default PostgreSQL service name.

Default value: $postgresql::server::service_name

service_enable

Data type: Boolean

Enable the PostgreSQL service

Default value: $postgresql::server::service_enable

log_line_prefix

Data type: Optional[String[1]]

PostgreSQL log line prefix

Default value: $postgresql::server::log_line_prefix

timezone

Data type: Optional[String[1]]

Set timezone for the PostgreSQL instance

Default value: $postgresql::server::timezone

password_encryption

Data type: Optional[Postgresql::Pg_password_encryption]

Specify the type of encryption set for the password.

Default value: $postgresql::server::password_encryption

extra_systemd_config

Data type: Optional[String]

Adds extra config to systemd config file, can for instance be used to add extra openfiles. This can be a multi line string

Default value: $postgresql::server::extra_systemd_config

postgresql::server::instance::initdb

Manages initdb feature for a postgresql::server instance

Parameters

The following parameters are available in the postgresql::server::instance::initdb defined type:

auth_host

Data type: Optional[String[1]]

auth method used by default for host authorization

Default value: $postgresql::server::auth_host

auth_local

Data type: Optional[String[1]]

auth method used by default for local authorization

Default value: $postgresql::server::auth_local

data_checksums

Data type: Optional[Boolean]

Boolean. Use checksums on data pages to help detect corruption by the I/O system that would otherwise be silent.

Default value: $postgresql::server::data_checksums

datadir

Data type: String[1]

PostgreSQL data directory

Default value: $postgresql::server::datadir

encoding

Data type: Optional[String[1]]

Sets the default encoding for all databases created with this module. On certain operating systems this is also used during the template1 initialization, so it becomes a default outside of the module as well.

Default value: $postgresql::server::encoding

group

Data type: String[1]

Overrides the default postgres user group to be used for related files in the file system.

Default value: $postgresql::server::group

initdb_path

Data type: Stdlib::Absolutepath

Specifies the path to the initdb command.

Default value: $postgresql::server::initdb_path

lc_messages

Data type: Optional[String[1]]

locale used for logging and system messages

Default value: $postgresql::server::lc_messages

locale

Data type: Optional[String[1]]

Sets the default database locale for all databases created with this module. On certain operating systems this is used during the template1 initialization as well, so it becomes a default outside of the module. Warning: This option is used during initialization by initdb, and cannot be changed later. If set, checksums are calculated for all objects, in all databases.

Default value: $postgresql::server::locale

logdir

Data type: Optional[String[1]]

PostgreSQL log directory

Default value: $postgresql::server::logdir

manage_datadir

Data type: Boolean

Set to false if you have file{ $datadir: } already defined

Default value: $postgresql::server::manage_datadir

manage_logdir

Data type: Boolean

Set to false if you have file{ $logdir: } already defined

Default value: $postgresql::server::manage_logdir

manage_xlogdir

Data type: Boolean

Set to false if you have file{ $xlogdir: } already defined

Default value: $postgresql::server::manage_xlogdir

module_workdir

Data type: String[1]

Working directory for the PostgreSQL module

Default value: $postgresql::server::module_workdir

needs_initdb

Data type: Boolean

Explicitly calls the initdb operation after server package is installed and before the PostgreSQL service is started.

Default value: $postgresql::server::needs_initdb

user

Data type: String[1]

Overrides the default PostgreSQL super user and owner of PostgreSQL related files in the file system.

Default value: $postgresql::server::user

username

Data type: Optional[String[1]]

username of user running the postgres instance

Default value: $postgresql::server::username

xlogdir

Data type: Optional[String[1]]

PostgreSQL xlog/WAL directory

Default value: $postgresql::server::xlogdir

postgresql::server::instance::late_initdb

Manage the default encoding when database initialization is managed by the package

Parameters

The following parameters are available in the postgresql::server::instance::late_initdb defined type:

encoding

Data type: Optional[String[1]]

Sets the default encoding for all databases created with this module. On certain operating systems this is also used during the template1 initialization, so it becomes a default outside of the module as well.

Default value: $postgresql::server::encoding

user

Data type: String[1]

Overrides the default PostgreSQL super user and owner of PostgreSQL related files in the file system.

Default value: $postgresql::server::user

group

Data type: String[1]

Overrides the default postgres user group to be used for related files in the file system.

Default value: $postgresql::server::group

psql_path

Data type: Stdlib::Absolutepath

Specifies the path to the psql command.

Default value: $postgresql::server::psql_path

port

Data type: Stdlib::Port

Specifies the port for the PostgreSQL server to listen on. Note: The same port number is used for all IP addresses the server listens on. Also, for Red Hat systems and early Debian systems, changing the port causes the server to come to a full stop before being able to make the change.

Default value: $postgresql::server::port

module_workdir

Data type: String[1]

Working directory for the PostgreSQL module

Default value: $postgresql::server::module_workdir

postgresql::server::instance::passwd

Overrides the default PostgreSQL superuser

Parameters

The following parameters are available in the postgresql::server::instance::passwd defined type:

user

Data type: String[1]

Overrides the default PostgreSQL super user and owner of PostgreSQL related files in the file system.

Default value: $postgresql::server::user

group

Data type: String[1]

Overrides the default postgres user group to be used for related files in the file system. Default value: 5432. Meaning the Postgres server listens on TCP port 5432.

Default value: $postgresql::server::group

psql_path

Data type: Stdlib::Absolutepath

Specifies the path to the psql command.

Default value: $postgresql::server::psql_path

port

Data type: Stdlib::Port

Specifies the port for the PostgreSQL server to listen on. Note: The same port number is used for all IP addresses the server listens on. Also, for Red Hat systems and early Debian systems, changing the port causes the server to come to a full stop before being able to make the change.

Default value: $postgresql::server::port

database

Data type: String[1]

Specifies the name of the database to connect with. On most systems this is 'postgres'.

Default value: $postgresql::server::default_database

module_workdir

Data type: String[1]

Working directory for the PostgreSQL module

Default value: $postgresql::server::module_workdir

postgres_password

Data type: Optional[Variant[String[1], Sensitive[String[1]], Integer]]

Sets the password for the postgres user to your specified value. By default, this setting uses the superuser account in the Postgres database, with a user called postgres and no password.

Default value: $postgresql::server::postgres_password

postgresql::server::instance::reload

Overrides the default reload or status command for your PostgreSQL service

Parameters

The following parameters are available in the postgresql::server::instance::reload defined type:

service_reload

Data type: String[1]

Overrides the default reload command for your PostgreSQL service.

Default value: $postgresql::server::service_reload

service_status

Data type: String[1]

Overrides the default status check command for your PostgreSQL service.

Default value: $postgresql::server::service_status

postgresql::server::instance::service

Manages the service for the postgres main instance (default) or additional instances

Parameters

The following parameters are available in the postgresql::server::instance::service defined type:

service_ensure

Data type: Variant[Enum['running', 'stopped'], Boolean]

Ensure service is installed

Default value: $postgresql::server::service_ensure

service_enable

Data type: Boolean

Enable the PostgreSQL service

Default value: $postgresql::server::service_enable

service_manage

Data type: Boolean

Defines whether or not Puppet should manage the service.

Default value: $postgresql::server::service_manage

service_name

Data type: String[1]

Overrides the default PostgreSQL service name.

Default value: $postgresql::server::service_name

service_provider

Data type: Optional[String[1]]

Overrides the default PostgreSQL service provider.

Default value: $postgresql::server::service_provider

service_status

Data type: String[1]

Overrides the default status check command for your PostgreSQL service.

Default value: $postgresql::server::service_status

user

Data type: String[1]

Overrides the default PostgreSQL super user and owner of PostgreSQL related files in the file system.

Default value: $postgresql::server::user

port

Data type: Stdlib::Port

Specifies the port for the PostgreSQL server to listen on. Note: The same port number is used for all IP addresses the server listens on. Also, for Red Hat systems and early Debian systems, changing the port causes the server to come to a full stop before being able to make the change. Default value: 5432. Meaning the Postgres server listens on TCP port 5432.

Default value: $postgresql::server::port

default_database

Data type: String[1]

Specifies the name of the default database to connect with. On most systems this is 'postgres'.

Default value: $postgresql::server::default_database

psql_path

Data type: Stdlib::Absolutepath

Specifies the path to the psql command.

Default value: $postgresql::server::psql_path

connect_settings

Data type: Hash

Specifies a hash of environment variables used when connecting to a remote server. Becomes the default for other defined types, such as postgresql::server::role.

Default value: $postgresql::server::default_connect_settings

postgresql::server::pg_hba_rule

This resource manages an individual rule that applies to the file defined in target.

Parameters

The following parameters are available in the postgresql::server::pg_hba_rule defined type:

type

Data type: Postgresql::Pg_hba_rule_type

Sets the type of rule.

database

Data type: String[1]

Sets a comma-separated list of databases that this rule matches.

user

Data type: String[1]

Sets a comma-separated list of users that this rule matches.

auth_method

Data type: String[1]

Provides the method that is used for authentication for the connection that this rule matches. Described further in the PostgreSQL pg_hba.conf documentation.

address

Data type: Optional[Postgresql::Pg_hba_rule_address]

Sets a address for this rule matching when the type is not 'local'. Value can either be IPv4 CIDR, IPv6 CIDR, a FQDN, the strings 'all', 'samehost' or 'samenet' or a domain either with or without starting dot (.) https://www.postgresql.org/docs/current/auth-pg-hba-conf.html

Default value: undef

description

Data type: String[1]

Defines a longer description for this rule, if required. This description is placed in the comments above the rule in pg_hba.conf. Default value: 'none'.

Default value: 'none'

auth_option

Data type: Optional[String]

For certain auth_method settings there are extra options that can be passed. Consult the PostgreSQL pg_hba.conf documentation for further details.

Default value: undef

order

Data type: Variant[String, Integer]

Sets an order for placing the rule in pg_hba.conf. This can be either a string or an integer. If it is an integer, it will be converted to a string by zero-padding it to three digits. E.g. 42 will be zero-padded to the string '042'. The pg_hba_rule fragments are sorted using the alpha sorting order. Default value: 150.

Default value: 150

target

Data type: Stdlib::Absolutepath

Provides the target for the rule, and is generally an internal only property. Use with caution.

Default value: $postgresql::server::pg_hba_conf_path

postgresql_version

Data type: String

Manages pg_hba.conf without managing the entire PostgreSQL instance.

Default value: $postgresql::server::_version

postgresql::server::pg_ident_rule

This resource manages an individual rule that applies to the file defined in target.

Parameters

The following parameters are available in the postgresql::server::pg_ident_rule defined type:

map_name

Data type: String[1]

Sets the name of the user map that is used to refer to this mapping in pg_hba.conf.

system_username

Data type: String[1]

Specifies the operating system user name (the user name used to connect to the database).

database_username

Data type: String[1]

Specifies the user name of the database user. The system_username is mapped to this user name.

description

Data type: String[1]

Sets a longer description for this rule if required. This description is placed in the comments above the rule in pg_ident.conf.

Default value: 'none'

order

Data type: String[1]

Defines an order for placing the mapping in pg_ident.conf. Default value: 150.

Default value: '150'

target

Data type: Stdlib::Absolutepath

Provides the target for the rule and is generally an internal only property. Use with caution.

Default value: $postgresql::server::pg_ident_conf_path

postgresql::server::reassign_owned_by

Define for reassigning the ownership of objects within a database.

  • Note This enables us to force the a particular ownership for objects within a database

Parameters

The following parameters are available in the postgresql::server::reassign_owned_by defined type:

old_role

Data type: String

Specifies the role or user who is the current owner of the objects in the specified db

new_role

Data type: String

Specifies the role or user who will be the new owner of these objects

db

Data type: String

Specifies the database to which the 'REASSIGN OWNED' will be applied

psql_user

Data type: String

Specifies the OS user for running psql.

Default value: $postgresql::server::user

port

Data type: Stdlib::Port

Port to use when connecting.

Default value: $postgresql::server::port

connect_settings

Data type: Hash

Specifies a hash of environment variables used when connecting to a remote server.

Default value: $postgresql::server::default_connect_settings

postgresql::server::recovery

This resource manages the parameters that applies to the recovery.conf template.

  • Note Allows you to create the content for recovery.conf. For more details see the usage example and the PostgreSQL documentation. Every parameter value is a string set in the template except recovery_target_inclusive, pause_at_recovery_target, standby_mode and recovery_min_apply_delay. A detailed description of all listed parameters can be found in the PostgreSQL documentation. Only the specified parameters are recognized in the template. The recovery.conf is only created if at least one parameter is set and manage_recovery_conf is set to true.

Parameters

The following parameters are available in the postgresql::server::recovery defined type:

restore_command

Data type: Optional[String]

The shell command to execute to retrieve an archived segment of the WAL file series.

Default value: undef

archive_cleanup_command

Data type: Optional[String[1]]

This optional parameter specifies a shell command that will be executed at every restartpoint.

Default value: undef

recovery_end_command

Data type: Optional[String[1]]

This parameter specifies a shell command that will be executed once only at the end of recovery.

Default value: undef

recovery_target_name

Data type: Optional[String[1]]

This parameter specifies the named restore point (created with pg_create_restore_point()) to which recovery will proceed.

Default value: undef

recovery_target_time

Data type: Optional[String[1]]

This parameter specifies the time stamp up to which recovery will proceed.

Default value: undef

recovery_target_xid

Data type: Optional[String[1]]

This parameter specifies the transaction ID up to which recovery will proceed.

Default value: undef

recovery_target_inclusive

Data type: Optional[Boolean]

Specifies whether to stop just after the specified recovery target (true), or just before the recovery target (false).

Default value: undef

recovery_target

Data type: Optional[String[1]]

This parameter specifies that recovery should end as soon as a consistent state is reached, i.e. as early as possible.

Default value: undef

recovery_target_timeline

Data type: Optional[String[1]]

Specifies recovering into a particular timeline.

Default value: undef

pause_at_recovery_target

Data type: Optional[Boolean]

Specifies whether recovery should pause when the recovery target is reached.

Default value: undef

standby_mode

Data type: Optional[String[1]]

Specifies whether to start the PostgreSQL server as a standby.

Default value: undef

primary_conninfo

Data type: Optional[String[1]]

Specifies a connection string to be used for the standby server to connect with the primary.

Default value: undef

primary_slot_name

Data type: Optional[String[1]]

Optionally specifies an existing replication slot to be used when connecting to the primary via streaming replication to control resource removal on the upstream node.

Default value: undef

trigger_file

Data type: Optional[String[1]]

Specifies a trigger file whose presence ends recovery in the standby.

Default value: undef

recovery_min_apply_delay

Data type: Optional[Integer]

This parameter allows you to delay recovery by a fixed period of time, measured in milliseconds if no unit is specified.

Default value: undef

target

Data type: Stdlib::Absolutepath

Provides the target for the rule, and is generally an internal only property. Use with caution.

Default value: $postgresql::server::recovery_conf_path

postgresql::server::role

Define for creating a database role.

Parameters

The following parameters are available in the postgresql::server::role defined type:

update_password

Data type: Boolean

If set to true, updates the password on changes. Set this to false to not modify the role's password after creation.

Default value: true

password_hash

Data type: Variant[Boolean, String, Sensitive[String]]

Sets the hash to use during password creation.

Default value: false

createdb

Data type: Boolean

Specifies whether to grant the ability to create new databases with this role.

Default value: false

createrole

Data type: Boolean

Specifies whether to grant the ability to create new roles with this role.

Default value: false

db

Data type: String[1]

Database used to connect to.

Default value: $postgresql::server::default_database

port

Data type: Optional[Stdlib::Port]

Port to use when connecting.

Default value: undef

login

Data type: Boolean

Specifies whether to grant login capability for the new role.

Default value: true

inherit

Data type: Boolean

Specifies whether to grant inherit capability for the new role.

Default value: true

superuser

Data type: Boolean

Specifies whether to grant super user capability for the new role.

Default value: false

replication

Data type: Boolean

Provides provides replication capabilities for this role if set to true.

Default value: false

connection_limit

Data type: String[1]

Specifies how many concurrent connections the role can make. Default value: '-1', meaning no limit.

Default value: '-1'

username

Data type: String[1]

Defines the username of the role to create.

Default value: $title

connect_settings

Data type: Hash

Specifies a hash of environment variables used when connecting to a remote server.

Default value: $postgresql::server::default_connect_settings

ensure

Data type: Enum['present', 'absent']

Specify whether to create or drop the role. Specifying 'present' creates the role. Specifying 'absent' drops the role.

Default value: 'present'

psql_user

Data type: String[1]

Sets the OS user to run psql

Default value: $postgresql::server::user

psql_group

Data type: String[1]

Sets the OS group to run psql

Default value: $postgresql::server::group

psql_path

Data type: Stdlib::Absolutepath

Sets path to psql command

Default value: $postgresql::server::psql_path

module_workdir

Data type: String[1]

Specifies working directory under which the psql command should be executed. May need to specify if '/tmp' is on volume mounted with noexec option.

Default value: $postgresql::server::module_workdir

hash

Data type: Optional[Enum['md5', 'scram-sha-256']]

Specify the hash method for pg password

Default value: undef

salt

Data type: Optional[Variant[String[1], Integer]]

Specify the salt use for the scram-sha-256 encoding password (default username)

Default value: undef

postgresql::server::schema

Create a new schema.

  • Note The database must exist and the PostgreSQL user should have enough privileges

Examples

postgresql::server::schema {'private':
    db => 'template1',
}

Parameters

The following parameters are available in the postgresql::server::schema defined type:

db

Data type: String[1]

Required. Sets the name of the database in which to create this schema.

Default value: $postgresql::server::default_database

owner

Data type: Optional[String[1]]

Sets the default owner of the schema.

Default value: undef

schema

Data type: String[1]

Sets the name of the schema.

Default value: $title

connect_settings

Data type: Hash

Specifies a hash of environment variables used when connecting to a remote server.

Default value: $postgresql::server::default_connect_settings

postgresql::server::table_grant

This resource wraps the grant resource to manage table grants specifically.

Parameters

The following parameters are available in the postgresql::server::table_grant defined type:

privilege

Data type:

Enum['ALL', 'SELECT', 'INSERT', 'UPDATE', 'DELETE', 'TRUNCATE', 'REFERENCES', 'TRIGGER', 'all', 'select', 'insert', 'update', 'delete',
  'truncate', 'references', 'trigger']

Specifies comma-separated list of privileges to grant. Valid options: 'ALL', 'SELECT', 'INSERT', 'UPDATE', 'DELETE', 'TRUNCATE', 'REFERENCES', 'TRIGGER'.

table

Data type: String[1]

Specifies the table to which you are granting access.

db

Data type: String[1]

Specifies which database the table is in.

role

Data type: String[1]

Specifies the role or user to whom you are granting access.

ensure

Data type: Optional[Enum['present', 'absent']]

Specifies whether to grant or revoke the privilege. Default is to grant the privilege.

Default value: undef

port

Data type: Optional[Stdlib::Port]

Port to use when connecting.

Default value: undef

psql_db

Data type: Optional[String[1]]

Specifies the database to execute the grant against. This should not ordinarily be changed from the default.

Default value: undef

psql_user

Data type: Optional[String[1]]

Specifies the OS user for running psql.

Default value: undef

connect_settings

Data type: Optional[Hash]

Specifies a hash of environment variables used when connecting to a remote server.

Default value: undef

onlyif_exists

Data type: Boolean

Create grant only if it doesn't exist.

Default value: false

postgresql::server::tablespace

This module creates tablespace.

Parameters

The following parameters are available in the postgresql::server::tablespace defined type:

location

Data type: String[1]

Specifies the path to locate this tablespace.

manage_location

Data type: Boolean

Set to false if you have file{ $location: } already defined

Default value: true

owner

Data type: Optional[String[1]]

Specifies the default owner of the tablespace.

Default value: undef

spcname

Data type: String[1]

Specifies the name of the tablespace.

Default value: $title

connect_settings

Data type: Hash

Specifies a hash of environment variables used when connecting to a remote server.

Default value: $postgresql::server::default_connect_settings

Resource types

postgresql_conf

This type allows puppet to manage postgresql.conf parameters.

Properties

The following properties are available in the postgresql_conf type.

ensure

Valid values: present, absent

The basic property that the resource should be in.

Default value: present

target

The path to postgresql.conf

value

The value to set for this parameter.

Parameters

The following parameters are available in the postgresql_conf type.

name

Valid values: %r{^[\w.]+$}

namevar

The postgresql parameter name to manage.

provider

The specific backend to use for this postgresql_conf resource. You will seldom need to specify this --- Puppet will usually discover the appropriate provider for your platform.

postgresql_conn_validator

Verify that a connection can be successfully established between a node and the PostgreSQL server. Its primary use is as a precondition to prevent configuration changes from being applied if the PostgreSQL server cannot be reached, but it could potentially be used for other purposes such as monitoring.

Properties

The following properties are available in the postgresql_conn_validator type.

ensure

Valid values: present, absent

Ensure connection validation

Default value: present

Parameters

The following parameters are available in the postgresql_conn_validator type.

command

Command to run against target database.

Default value: SELECT 1

connect_settings

Hash of environment variables for connection to a db.

db_name

The name of the database you are trying to validate a connection with.

db_password

The password required to access the target PostgreSQL database.

db_username

A user that has access to the target PostgreSQL database.

host

The DNS name or IP address of the server where PostgreSQL should be running.

name

namevar

An arbitrary name used as the identity of the resource.

port

The port that the PostgreSQL server should be listening on.

provider

The specific backend to use for this postgresql_conn_validator resource. You will seldom need to specify this --- Puppet will usually discover the appropriate provider for your platform.

psql_path

Path to the psql command.

run_as

System user that will run the psql command.

sleep

The length of sleep time between connection tries.

Default value: 2

tries

The number of tries to validate the connection to the target PostgreSQL database.

Default value: 10

postgresql_psql

An arbitrary tag for your own reference; the name of the message.

Properties

The following properties are available in the postgresql_psql type.

command

The SQL command to execute via psql.

Parameters

The following parameters are available in the postgresql_psql type.

connect_settings

Connection settings that will be used when connecting to postgres

cwd

The working directory under which the psql command should be executed.

Default value: /tmp

db

The name of the database to execute the SQL command against, this overrides any PGDATABASE value in connect_settings

environment

Any additional environment variables you want to set for a SQL command. Multiple environment variables should be specified as an array.

name

namevar

An arbitrary tag for your own reference; the name of the message.

onlyif

An optional SQL command to execute prior to the main :command; this is generally intended to be used for idempotency, to check for the existence of an object in the database to determine whether or not the main SQL command needs to be executed at all.

port

The port of the database server to execute the SQL command against, this overrides any PGPORT value in connect_settings.

provider

The specific backend to use for this postgresql_psql resource. You will seldom need to specify this --- Puppet will usually discover the appropriate provider for your platform.

psql_group

The system user group account under which the psql command should be executed.

Default value: postgres

psql_path

The path to psql executable.

Default value: psql

psql_user

The system user account under which the psql command should be executed.

Default value: postgres

refreshonly

Valid values: true, false

If 'true', then the SQL will only be executed via a notify/subscribe event.

Default value: false

search_path

The schema search path to use when executing the SQL command

sensitive

Valid values: true, false

If 'true', then the executed command will not be echoed into the log. Use this to protect sensitive information passing through.

Default value: false

unless

An optional SQL command to execute prior to the main :command; this is generally intended to be used for idempotency, to check for the existence of an object in the database to determine whether or not the main SQL command needs to be executed at all.'

postgresql_replication_slot

This type allows to create and destroy replication slots to register warm standby replication on a Postgresql primary server.

Properties

The following properties are available in the postgresql_replication_slot type.

ensure

Valid values: present, absent

The basic property that the resource should be in.

Default value: present

Parameters

The following parameters are available in the postgresql_replication_slot type.

name

Valid values: %r{^[a-z0-9_]+$}

namevar

The name of the slot to create. Must be a valid replication slot name.

provider

The specific backend to use for this postgresql_replication_slot resource. You will seldom need to specify this --- Puppet will usually discover the appropriate provider for your platform.

Functions

postgresql::default

Type: Puppet Language

This function pull default values from the params class or globals class if the value is not present in params.

Examples

postgresql::default('variable')

postgresql::default(String $parameter_name)

The postgresql::default function.

Returns: Any

Examples
postgresql::default('variable')
parameter_name

Data type: String

postgresql::postgresql_escape

Type: Ruby 4.x API

This function escapes a string using Dollar Quoting using a randomly generated tag if required.

postgresql::postgresql_escape(String[1] $input_string)

The postgresql::postgresql_escape function.

Returns: String A Dollar Quoted string

input_string

Data type: String[1]

The unescaped string you want to escape using dollar quoting

postgresql::postgresql_password

Type: Ruby 4.x API

This function returns the postgresql password hash from the clear text username / password

postgresql::postgresql_password(Variant[String[1], Integer] $username, Variant[String[1], Sensitive[String[1]], Integer] $password, Optional[Boolean] $sensitive, Optional[Optional[Postgresql::Pg_password_encryption]] $hash, Optional[Optional[Variant[String[1], Integer]]] $salt)

The postgresql::postgresql_password function.

Returns: Variant[String, Sensitive[String]] The postgresql password hash from the clear text username / password.

username

Data type: Variant[String[1], Integer]

The clear text username

password

Data type: Variant[String[1], Sensitive[String[1]], Integer]

The clear text password

sensitive

Data type: Optional[Boolean]

If the Postgresql-Passwordhash should be of Datatype Sensitive[String]

hash

Data type: Optional[Optional[Postgresql::Pg_password_encryption]]

Set type for password hash

salt

Data type: Optional[Optional[Variant[String[1], Integer]]]

Use a specific salt value for scram-sha-256, default is username

postgresql::prepend_sql_password

Type: Ruby 4.x API

This function exists for usage of a role password that is a deferred function

postgresql::prepend_sql_password(String $password)

The postgresql::prepend_sql_password function.

Returns: String

password

Data type: String

The clear text password

postgresql_escape

Type: Ruby 4.x API

DEPRECATED. Use the namespaced function postgresql::postgresql_escape instead.

postgresql_escape(Any *$args)

The postgresql_escape function.

Returns: Any

*args

Data type: Any

postgresql_password

Type: Ruby 4.x API

DEPRECATED. Use the namespaced function postgresql::postgresql_password instead.

postgresql_password(Any *$args)

The postgresql_password function.

Returns: Any

*args

Data type: Any

Data types

Postgresql::Pg_hba_rule

type for all parameters in the postgresql::server::hba_rule defined resource

Alias of

Struct[{
    Optional[description]        => String,
    type                         => Postgresql::Pg_hba_rule_type,
    database                     => String,
    user                         => String,
    Optional[address]            => Optional[Postgresql::Pg_hba_rule_address],
    auth_method                  => String,
    Optional[auth_option]        => Optional[String],
    Optional[order]              => Variant[String,Integer],
    Optional[target]             => Stdlib::Absolutepath,
    Optional[postgresql_version] => String,
}]

Postgresql::Pg_hba_rule_address

Supported address types

Alias of Variant[Stdlib::IP::Address::V4::CIDR, Stdlib::IP::Address::V6::CIDR, Stdlib::Fqdn, Enum['all', 'samehost', 'samenet'], Pattern[/^\.(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]$/]]

Postgresql::Pg_hba_rule_type

enum for all different types for the pg_hba_conf

Alias of Enum['local', 'host', 'hostssl', 'hostnossl', 'hostgssenc', 'hostnogssenc']

Postgresql::Pg_hba_rules

validates a hash of entries for postgresql::server::pg_hab_conf

Alias of Hash[String[1], Postgresql::Pg_hba_rule]

Postgresql::Pg_password_encryption

the supported password_encryption

Alias of Enum['md5', 'scram-sha-256']

Tasks

sql

Allows you to execute arbitary SQL

Supports noop? false

Parameters

database

Data type: Optional[String[1]]

Database to connect to

host

Data type: Optional[String[1]]

Hostname to connect to

password

Data type: Optional[String[1]]

The password

port

Data type: Optional[String[1]]

The port

sql

Data type: String[1]

The SQL you want to execute

user

Data type: Optional[String[1]]

The user