postgresql::client
: Installs PostgreSQL client software. Set the following parameters if you have a custom version you would like to install.postgresql::globals
: Class for setting cross-class global overrides.postgresql::lib::devel
: This class installs postgresql development libraries.postgresql::lib::docs
: Installs PostgreSQL bindings for Postgres-Docs. Set the following parameters if you have a custom version you would like to install.postgresql::lib::java
: This class installs the postgresql jdbc connector.postgresql::lib::perl
: This class installs the perl libs for postgresql.postgresql::lib::python
: This class installs the python libs for postgresql.postgresql::server
: This installs a PostgreSQL serverpostgresql::server::contrib
: Install the contrib postgresql packaging.postgresql::server::plperl
: This class installs the PL/Perl procedural language for postgresql.postgresql::server::plpython
: This class installs the PL/Python procedural language for postgresql.postgresql::server::postgis
: Install the postgis postgresql packaging.
postgresql::dnfmodule
: Manage the DNF modulepostgresql::params
postgresql::repo
postgresql::repo::apt_postgresql_org
postgresql::repo::yum_postgresql_org
postgresql::server::config
postgresql::server::initdb
postgresql::server::install
postgresql::server::passwd
postgresql::server::reload
postgresql::server::service
postgresql::server::config_entry
: Manage a postgresql.conf entry.postgresql::server::database
: Define for creating a database.postgresql::server::database_grant
: Manage a database grant.postgresql::server::db
: Define for conveniently creating a role, database and assigning the correctpermissions.postgresql::server::extension
: Activate an extension on a postgresql database.postgresql::server::grant
: Define for granting permissions to roles.postgresql::server::grant_role
: Define for granting membership to a role.postgresql::server::pg_hba_rule
: This resource manages an individual rule that applies to the file defined in target.postgresql::server::pg_ident_rule
: This resource manages an individual rule that applies to the file defined in target.postgresql::server::reassign_owned_by
: Define for reassigning the ownership of objects within a database.postgresql::server::recovery
: This resource manages the parameters that applies to the recovery.conf template.postgresql::server::role
: Define for creating a database role.postgresql::server::schema
: Create a new schema.postgresql::server::table_grant
: This resource wraps the grant resource to manage table grants specifically.postgresql::server::tablespace
: This module creates tablespace.postgresql::validate_db_connection
: This type validates that a successful postgres connection.
postgresql_conf
: This type allows puppet to manage postgresql.conf parameters.postgresql_conn_validator
: Verify if a connection can be successfully establishedpostgresql_psql
: An arbitrary tag for your own reference; the name of the message.postgresql_replication_slot
: Manages Postgresql replication slots.
postgresql::default
: This function pull default values from theparams
class orglobals
class if the value is not present inparams
.postgresql::postgresql_escape
: This function escapes a string using Dollar Quoting using a randomly generated tag if required.postgresql::postgresql_password
: This function returns the postgresql password hash from the clear text username / passwordpostgresql_escape
: DEPRECATED. Use the namespaced functionpostgresql::postgresql_escape
instead.postgresql_password
: DEPRECATED. Use the namespaced functionpostgresql::postgresql_password
instead.
postgresql::postgresql_acls_to_resources_hash
: This internal function translates the ipv(4|6)acls format into a resource suitable for create_resources.
sql
: Allows you to execute arbitary SQL
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.
The following parameters are available in the postgresql::client
class:
Data type: Enum['file', 'absent']
Ensure the connection validation script is present
Default value: 'file'
Data type: Stdlib::Absolutepath
Optional. Absolute path for the postgresql connection validation script.
Default value: $postgresql::params::validcon_script_path
Data type: String[1]
Sets the name of the PostgreSQL client package.
Default value: $postgresql::params::client_package_name
Data type: String[1]
Ensure the client package is installed
Default value: 'present'
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.
The following parameters are available in the postgresql::globals
class:
client_package_name
server_package_name
contrib_package_name
devel_package_name
java_package_name
docs_package_name
perl_package_name
plperl_package_name
plpython_package_name
python_package_name
postgis_package_name
service_name
service_provider
service_status
default_database
validcon_script_path
initdb_path
createdb_path
psql_path
pg_hba_conf_path
pg_ident_conf_path
postgresql_conf_path
postgresql_conf_mode
recovery_conf_path
default_connect_settings
pg_hba_conf_defaults
datadir
confdir
bindir
xlogdir
logdir
log_line_prefix
user
group
version
postgis_version
repo_proxy
repo_baseurl
yum_repo_commonurl
needs_initdb
encoding
locale
data_checksums
timezone
manage_pg_hba_conf
manage_pg_ident_conf
manage_recovery_conf
manage_postgresql_conf_perms
manage_datadir
manage_logdir
manage_xlogdir
manage_package_repo
manage_dnf_module
module_workdir
manage_selinux
Data type: Any
Overrides the default PostgreSQL client package name.
Default value: undef
Data type: Any
Overrides the default PostgreSQL server package name.
Default value: undef
Data type: Any
Overrides the default PostgreSQL contrib package name.
Default value: undef
Data type: Any
Overrides the default PostgreSQL devel package name.
Default value: undef
Data type: Any
Overrides the default PostgreSQL java package name.
Default value: undef
Data type: Any
Overrides the default PostgreSQL docs package name.
Default value: undef
Data type: Any
Overrides the default PostgreSQL Perl package name.
Default value: undef
Data type: Any
Overrides the default PostgreSQL PL/Perl package name.
Default value: undef
Data type: Any
Overrides the default PostgreSQL PL/Python package name.
Default value: undef
Data type: Any
Overrides the default PostgreSQL Python package name.
Default value: undef
Data type: Any
Overrides the default PostgreSQL PostGIS package name.
Default value: undef
Data type: Any
Overrides the default PostgreSQL service name.
Default value: undef
Data type: Any
Overrides the default PostgreSQL service provider.
Default value: undef
Data type: Any
Overrides the default status check command for your PostgreSQL service.
Default value: undef
Data type: Any
Specifies the name of the default database to connect with.
Default value: undef
Data type: Any
Scipt path for the connection validation check.
Default value: undef
Data type: Any
Path to the initdb command.
Default value: undef
Data type: Any
Deprecated. Path to the createdb command.
Default value: undef
Data type: Any
Sets the path to the psql command.
Default value: undef
Data type: Any
Specifies the path to your pg_hba.conf file.
Default value: undef
Data type: Any
Specifies the path to your pg_ident.conf file.
Default value: undef
Data type: Any
Sets the path to your postgresql.conf file.
Default value: undef
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
Data type: Any
Path to your recovery.conf file.
Default value: undef
Data type: Any
Default connection settings.
Default value: {}
Data type: Any
Disables the defaults supplied with the module for pg_hba.conf if set to false.
Default value: undef
Data type: Any
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
Data type: Any
Overrides the default PostgreSQL configuration directory for the target platform.
Default value: undef
Data type: Any
Overrides the default PostgreSQL binaries directory for the target platform.
Default value: undef
Data type: Any
Overrides the default PostgreSQL xlog directory.
Default value: undef
Data type: Any
Overrides the default PostgreSQL log directory.
Default value: undef
Data type: Any
Overrides the default PostgreSQL log prefix.
Default value: undef
Data type: Any
Overrides the default PostgreSQL super user and owner of PostgreSQL related files in the file system.
Default value: undef
Data type: Any
Overrides the default postgres user group to be used for related files in the file system.
Default value: undef
Data type: Any
The version of PostgreSQL to install and manage.
Default value: undef
Data type: Any
Defines the version of PostGIS to install, if you install PostGIS.
Default value: undef
Data type: Any
Sets the proxy option for the official PostgreSQL yum-repositories only.
Default value: undef
Data type: Any
Sets the baseurl for the PostgreSQL repository. Useful if you host your own mirror of the repository.
Default value: undef
Data type: Any
Sets the url for the PostgreSQL common Yum repository. Useful if you host your own mirror of the YUM repository.
Default value: undef
Data type: Any
Explicitly calls the initdb operation after the server package is installed and before the PostgreSQL service is started.
Default value: undef
Data type: Any
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
Data type: Any
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 type: Any
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
Data type: Any
Sets the default timezone of the postgresql server. The postgresql built-in default is taking the systems timezone information.
Default value: undef
Data type: Any
Allow Puppet to manage the pg_hba.conf file.
Default value: undef
Data type: Any
Allow Puppet to manage the pg_ident.conf file.
Default value: undef
Data type: Any
Allow Puppet to manage the recovery.conf file.
Default value: undef
Data type: Any
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
Data type: Any
Set to false if you have file{ $datadir: } already defined
Default value: undef
Data type: Any
Set to false if you have file{ $logdir: } already defined
Default value: undef
Data type: Any
Set to false if you have file{ $xlogdir: } already defined
Default value: undef
Data type: Any
Sets up official PostgreSQL repositories on your host if set to true.
Default value: undef
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
Data type: Any
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
Data type: Any
Default value: undef
This class installs postgresql development libraries.
The following parameters are available in the postgresql::lib::devel
class:
Data type: String
Override devel package name
Default value: $postgresql::params::devel_package_name
Data type: String[1]
Ensure the development libraries are installed
Default value: 'present'
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
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.
The following parameters are available in the postgresql::lib::docs
class:
Data type: String
Specifies the name of the PostgreSQL docs package.
Default value: $postgresql::params::docs_package_name
Data type: String[1]
Whether the PostgreSQL docs package resource should be present.
Default value: 'present'
This class installs the postgresql jdbc connector.
- Note Make sure to add any necessary yum or apt repositories if specifying a custom version.
The following parameters are available in the postgresql::lib::java
class:
Data type: String
Specifies the name of the PostgreSQL java package.
Default value: $postgresql::params::java_package_name
Data type: String[1]
Specifies whether the package is present.
Default value: 'present'
This class installs the perl libs for postgresql.
The following parameters are available in the postgresql::lib::perl
class:
Data type: String
Specifies the name of the PostgreSQL perl package to install.
Default value: $postgresql::params::perl_package_name
Data type: String[1]
Ensure the perl libs for postgresql are installed.
Default value: 'present'
This class installs the python libs for postgresql.
The following parameters are available in the postgresql::lib::python
class:
Data type: String[1]
The name of the PostgreSQL Python package.
Default value: $postgresql::params::python_package_name
Data type: String[1]
Ensure the python libs for postgresql are installed.
Default value: 'present'
This installs a PostgreSQL server
The following parameters are available in the postgresql::server
class:
postgres_password
package_name
package_ensure
plperl_package_name
plpython_package_name
service_ensure
service_enable
service_manage
service_name
service_restart_on_change
service_provider
service_reload
service_status
default_database
default_connect_settings
listen_addresses
port
ip_mask_deny_postgres_user
ip_mask_allow_all_users
ipv4acls
ipv6acls
initdb_path
createdb_path
psql_path
pg_hba_conf_path
pg_ident_conf_path
postgresql_conf_path
postgresql_conf_mode
recovery_conf_path
datadir
xlogdir
logdir
log_line_prefix
pg_hba_conf_defaults
user
group
needs_initdb
encoding
locale
data_checksums
timezone
manage_pg_hba_conf
manage_pg_ident_conf
manage_recovery_conf
manage_postgresql_conf_perms
module_workdir
manage_datadir
manage_logdir
manage_xlogdir
roles
config_entries
pg_hba_rules
version
extra_systemd_config
manage_selinux
password_encryption
Data type: Any
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
Data type: Any
Specifies the name of the package to use for installing the server software.
Default value: $postgresql::params::server_package_name
Data type: Any
Passes a value through to the package resource when creating the server instance.
Default value: $postgresql::params::package_ensure
Data type: Any
Sets the default package name for the PL/Perl extension.
Default value: $postgresql::params::plperl_package_name
Data type: Any
Sets the default package name for the PL/Python extension.
Default value: $postgresql::params::plpython_package_name
Data type: Any
Ensure service is installed
Default value: $postgresql::params::service_ensure
Data type: Any
Enable the PostgreSQL service
Default value: $postgresql::params::service_enable
Data type: Any
Defines whether or not Puppet should manage the service.
Default value: $postgresql::params::service_manage
Data type: Any
Overrides the default PostgreSQL service name.
Default value: $postgresql::params::service_name
Data type: Any
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
Data type: Any
Overrides the default PostgreSQL service provider.
Default value: $postgresql::params::service_provider
Data type: Any
Overrides the default reload command for your PostgreSQL service.
Default value: $postgresql::params::service_reload
Data type: Any
Overrides the default status check command for your PostgreSQL service.
Default value: $postgresql::params::service_status
Data type: Any
Specifies the name of the default database to connect with. On most systems this is 'postgres'.
Default value: $postgresql::params::default_database
Data type: Any
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
Data type: Any
Address list on which the PostgreSQL service will listen
Default value: $postgresql::params::listen_addresses
Data type: Any
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
Data type: Any
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
Data type: Any
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
Data type: Array[String[1]]
Lists strings for access control for connection method, users, databases, IPv4 addresses;
Default value: $postgresql::params::ipv4acls
Data type: Array[String[1]]
Lists strings for access control for connection method, users, databases, IPv6 addresses.
Default value: $postgresql::params::ipv6acls
Data type: Any
Specifies the path to the initdb command.
Default value: $postgresql::params::initdb_path
Data type: Any
Deprecated. Specifies the path to the createdb command.
Default value: $postgresql::params::createdb_path
Data type: Any
Specifies the path to the psql command.
Default value: $postgresql::params::psql_path
Data type: Any
Specifies the path to your pg_hba.conf file.
Default value: $postgresql::params::pg_hba_conf_path
Data type: Any
Specifies the path to your pg_ident.conf file.
Default value: $postgresql::params::pg_ident_conf_path
Data type: Any
Specifies the path to your postgresql.conf file.
Default value: $postgresql::params::postgresql_conf_path
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
Data type: Any
Specifies the path to your recovery.conf file.
Default value: $postgresql::params::recovery_conf_path
Data type: Any
PostgreSQL data directory
Default value: $postgresql::params::datadir
Data type: Any
PostgreSQL xlog directory
Default value: $postgresql::params::xlogdir
Data type: Any
PostgreSQL log directory
Default value: $postgresql::params::logdir
Data type: Any
PostgreSQL log line prefix
Default value: $postgresql::params::log_line_prefix
Data type: Any
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
Data type: Any
Overrides the default PostgreSQL super user and owner of PostgreSQL related files in the file system.
Default value: $postgresql::params::user
Data type: Any
Overrides the default postgres user group to be used for related files in the file system.
Default value: $postgresql::params::group
Data type: Any
Explicitly calls the initdb operation after server package is installed, and before the PostgreSQL service is started.
Default value: $postgresql::params::needs_initdb
Data type: Any
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
Data type: Any
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 type: Any
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
Data type: Any
Set timezone for the PostgreSQL instance
Default value: $postgresql::params::timezone
Data type: Any
Boolean. Whether to manage the pg_hba.conf.
Default value: $postgresql::params::manage_pg_hba_conf
Data type: Any
Boolean. Overwrites the pg_ident.conf file.
Default value: $postgresql::params::manage_pg_ident_conf
Data type: Any
Boolean. Specifies whether or not manage the recovery.conf.
Default value: $postgresql::params::manage_recovery_conf
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
Data type: Any
Working directory for the PostgreSQL module
Default value: $postgresql::params::module_workdir
Data type: Any
Set to false if you have file{ $datadir: } already defined
Default value: $postgresql::params::manage_datadir
Data type: Any
Set to false if you have file{ $logdir: } already defined
Default value: $postgresql::params::manage_logdir
Data type: Any
Set to false if you have file{ $xlogdir: } already defined
Default value: $postgresql::params::manage_xlogdir
Data type: Hash[String, Hash]
Specifies a hash from which to generate postgresql::server::role resources.
Default value: {}
Data type: Hash[String, Any]
Specifies a hash from which to generate postgresql::server::config_entry resources.
Default value: {}
Data type: Hash[String, Hash]
Specifies a hash from which to generate postgresql::server::pg_hba_rule resources.
Default value: {}
Data type: Any
Deprecated. Use postgresql::globals instead. Sets PostgreSQL version
Default value: undef
Data type: Any
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
Data type: Boolean
Default value: $postgresql::params::manage_selinux
Data type: Any
Default value: $postgresql::params::password_encryption
Install the contrib postgresql packaging.
The following parameters are available in the postgresql::server::contrib
class:
Data type: String
The name of the PostgreSQL contrib package.
Default value: $postgresql::params::contrib_package_name
Data type: String[1]
Ensure the contrib package is installed.
Default value: 'present'
This class installs the PL/Perl procedural language for postgresql.
The following parameters are available in the postgresql::server::plperl
class:
Data type: Any
The ensure parameter passed on to PostgreSQL PL/Perl package resource.
Default value: 'present'
Data type: Any
The name of the PostgreSQL PL/Perl package.
Default value: $postgresql::server::plperl_package_name
This class installs the PL/Python procedural language for postgresql.
The following parameters are available in the postgresql::server::plpython
class:
Data type: Any
Specifies whether the package is present.
Default value: 'present'
Data type: Any
Specifies the name of the postgresql PL/Python package.
Default value: $postgresql::server::plpython_package_name
Install the postgis postgresql packaging.
The following parameters are available in the postgresql::server::postgis
class:
Data type: String
Sets the package name.
Default value: $postgresql::params::postgis_package_name
Data type: String[1]
Specifies if the package is present or not.
Default value: 'present'
Manage a postgresql.conf entry.
The following parameters are available in the postgresql::server::config_entry
defined type:
Data type: Enum['present', 'absent']
Removes an entry if set to 'absent'.
Default value: 'present'
Data type: Any
Defines the value for the setting.
Default value: undef
Data type: Any
Path for postgresql.conf
Default value: false
Define for creating a database.
The following parameters are available in the postgresql::server::database
defined type:
Data type: Any
Sets a comment on the database.
Default value: undef
Data type: Any
Sets the name of the database.
Default value: $title
Data type: Any
Sets name of the database owner.
Default value: undef
Data type: Any
Sets tablespace for where to create this database.
Default value: undef
Data type: Any
Specifies the name of the template database from which to build this database. Default value: 'template0'.
Default value: 'template0'
Data type: Any
Overrides the character set during creation of the database.
Default value: $postgresql::server::encoding
Data type: Any
Overrides the locale during creation of the database.
Default value: $postgresql::server::locale
Data type: Any
Defines the database as a template if set to true.
Default value: false
Data type: Any
Specifies a hash of environment variables used when connecting to a remote server.
Default value: $postgresql::server::default_connect_settings
Manage a database grant.
The following parameters are available in the postgresql::server::database_grant
defined type:
Data type: Any
Specifies comma-separated list of privileges to grant. Valid options: 'ALL', 'CREATE', 'CONNECT', 'TEMPORARY', 'TEMP'.
Data type: Any
Specifies the database to which you are granting access.
Data type: Any
Specifies the role or user whom you are granting access to.
Data type: Any
Specifies whether to grant or revoke the privilege. Revoke or 'absent' works only in PostgreSQL version 9.1.24 or later.
Default value: undef
Data type: Any
Defines the database to execute the grant against. This should not ordinarily be changed from the default
Default value: undef
Data type: Any
Specifies the OS user for running psql. Default value: The default user for the module, usually 'postgres'.
Default value: undef
Data type: Any
Specifies a hash of environment variables used when connecting to a remote server.
Default value: undef
Define for conveniently creating a role, database and assigning the correctpermissions.
The following parameters are available in the postgresql::server::db
defined type:
Data type: Any
User to create and assign access to the database upon creation. Mandatory.
Data type: Any
Required Sets the password for the created user.
Data type: Any
Defines a comment to be stored about the database using the PostgreSQL COMMENT command.
Default value: undef
Data type: Any
Sets the name of the database to be created.
Default value: $title
Data type: Any
Overrides the character set during creation of the database.
Default value: $postgresql::server::encoding
Data type: Any
Overrides the locale during creation of the database.
Default value: $postgresql::server::locale
Data type: Any
Specifies the permissions to grant during creation. Default value: 'ALL'.
Default value: 'ALL'
Data type: Any
Defines the name of the tablespace to allocate the created database to.
Default value: undef
Data type: Any
Specifies the name of the template database from which to build this database. Defaults value: template0.
Default value: 'template0'
Data type: Any
Specifies that the database is a template, if set to true.
Default value: false
Data type: Any
Sets a user as the owner of the database.
Default value: undef
Activate an extension on a postgresql database.
The following parameters are available in the postgresql::server::extension
defined type:
database
extension
schema
version
ensure
package_name
package_ensure
port
connect_settings
database_resource_name
Data type: Any
Specifies the database on which to activate the extension.
Data type: Any
Specifies the extension to activate. If left blank, uses the name of the resource.
Default value: $name
Data type: Optional[String[1]]
Specifies the schema on which to activate the extension.
Default value: undef
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
Data type: String[1]
Specifies whether to activate or deactivate the extension. Valid options: 'present' or 'absent'.
Default value: 'present'
Data type: Any
Specifies a package to install prior to activating the extension.
Default value: undef
Data type: Any
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
Data type: Optional[Integer]
Port to use when connecting.
Default value: undef
Data type: Any
Specifies a hash of environment variables used when connecting to a remote server.
Default value: postgresql::default('default_connect_settings')
Data type: Any
Specifies the resource name of the DB being managed. Defaults to the parameter $database, if left blank.
Default value: $database
Define for granting permissions to roles.
The following parameters are available in the postgresql::server::grant
defined type:
role
db
privilege
object_type
object_name
psql_db
psql_user
port
onlyif_exists
connect_settings
ensure
group
psql_path
object_arguments
Data type: String
Specifies the role or user whom you are granting access to.
Data type: String
Specifies the database to which you are granting access.
Data type: String
Specifies the privilege to grant. Valid options: 'ALL', 'ALL PRIVILEGES' or 'object_type' dependent string.
Default value: ''
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'
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
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
Data type: String
Sets the OS user to run psql.
Default value: $postgresql::server::user
Data type: Integer
Port to use when connecting.
Default value: $postgresql::server::port
Data type: Boolean
Create grant only if doesn't exist
Default value: false
Data type: Hash
Specifies a hash of environment variables used when connecting to a remote server.
Default value: $postgresql::server::default_connect_settings
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'
Data type: String
Sets the OS group to run psql
Default value: $postgresql::server::group
Data type: String
Sets the path to psql command
Default value: $postgresql::server::psql_path
Data type: Array[String[1],0]
Default value: []
Define for granting membership to a role.
The following parameters are available in the postgresql::server::grant_role
defined type:
Data type: String[1]
Specifies the group role to which you are assigning a 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
Data type: Enum['present', 'absent']
Specifies whether to grant or revoke the membership. Valid options: 'present' or 'absent'.
Default value: 'present'
Data type: Any
Specifies the database to execute the grant against. This should not ordinarily be changed from the default
Default value: $postgresql::server::default_database
Data type: Any
Sets the OS user to run psql.
Default value: $postgresql::server::user
Data type: Any
Port to use when connecting.
Default value: $postgresql::server::port
Data type: Any
Specifies a hash of environment variables used when connecting to a remote server.
Default value: $postgresql::server::default_connect_settings
This resource manages an individual rule that applies to the file defined in target.
The following parameters are available in the postgresql::server::pg_hba_rule
defined type:
Data type: Enum['local', 'host', 'hostssl', 'hostnossl', 'hostgssenc']
Sets the type of rule. Enum['local','host','hostssl','hostnossl','hostgssenc'].
Data type: String
Sets a comma-separated list of databases that this rule matches.
Data type: String
Sets a comma-separated list of users that this rule matches.
Data type: String
Provides the method that is used for authentication for the connection that this rule matches. Described further in the PostgreSQL pg_hba.conf documentation.
Data type: Optional[String]
Sets a CIDR based address for this rule matching when the type is not 'local'.
Default value: undef
Data type: String
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'
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
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
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
Data type: String
Manages pg_hba.conf without managing the entire PostgreSQL instance.
Default value: $postgresql::server::_version
This resource manages an individual rule that applies to the file defined in target.
The following parameters are available in the postgresql::server::pg_ident_rule
defined type:
Data type: Any
Sets the name of the user map that is used to refer to this mapping in pg_hba.conf.
Data type: Any
Specifies the operating system user name (the user name used to connect to the database).
Data type: Any
Specifies the user name of the database user. The system_username is mapped to this user name.
Data type: Any
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'.
Default value: 'none'
Data type: Any
Defines an order for placing the mapping in pg_ident.conf. Default value: 150.
Default value: '150'
Data type: Any
Provides the target for the rule and is generally an internal only property. Use with caution.
Default value: $postgresql::server::pg_ident_conf_path
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
The following parameters are available in the postgresql::server::reassign_owned_by
defined type:
Data type: String
Specifies the role or user who is the current owner of the objects in the specified db
Data type: String
Specifies the role or user who will be the new owner of these objects
Data type: String
Specifies the database to which the 'REASSIGN OWNED' will be applied
Data type: String
Specifies the OS user for running psql.
Default value: $postgresql::server::user
Data type: Integer
Port to use when connecting.
Default value: $postgresql::server::port
Data type: Hash
Specifies a hash of environment variables used when connecting to a remote server.
Default value: $postgresql::server::default_connect_settings
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.
The following parameters are available in the postgresql::server::recovery
defined type:
restore_command
archive_cleanup_command
recovery_end_command
recovery_target_name
recovery_target_time
recovery_target_xid
recovery_target_inclusive
recovery_target
recovery_target_timeline
pause_at_recovery_target
standby_mode
primary_conninfo
primary_slot_name
trigger_file
recovery_min_apply_delay
target
Data type: Any
The shell command to execute to retrieve an archived segment of the WAL file series.
Default value: undef
Data type: Any
This optional parameter specifies a shell command that will be executed at every restartpoint.
Default value: undef
Data type: Any
This parameter specifies a shell command that will be executed once only at the end of recovery.
Default value: undef
Data type: Any
This parameter specifies the named restore point (created with pg_create_restore_point()) to which recovery will proceed.
Default value: undef
Data type: Any
This parameter specifies the time stamp up to which recovery will proceed.
Default value: undef
Data type: Any
This parameter specifies the transaction ID up to which recovery will proceed.
Default value: undef
Data type: Any
Specifies whether to stop just after the specified recovery target (true), or just before the recovery target (false).
Default value: undef
Data type: Any
This parameter specifies that recovery should end as soon as a consistent state is reached, i.e. as early as possible.
Default value: undef
Data type: Any
Specifies recovering into a particular timeline.
Default value: undef
Data type: Any
Specifies whether recovery should pause when the recovery target is reached.
Default value: undef
Data type: Any
Specifies whether to start the PostgreSQL server as a standby.
Default value: undef
Data type: Any
Specifies a connection string to be used for the standby server to connect with the primary.
Default value: undef
Data type: Any
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
Data type: Any
Specifies a trigger file whose presence ends recovery in the standby.
Default value: undef
Data type: Any
This parameter allows you to delay recovery by a fixed period of time, measured in milliseconds if no unit is specified.
Default value: undef
Data type: Any
Provides the target for the rule, and is generally an internal only property. Use with caution.
Default value: $postgresql::server::recovery_conf_path
Define for creating a database role.
The following parameters are available in the postgresql::server::role
defined type:
update_password
password_hash
createdb
createrole
db
port
login
inherit
superuser
replication
connection_limit
username
connect_settings
ensure
psql_user
psql_group
psql_path
module_workdir
Data type: Any
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
Data type: Any
Sets the hash to use during password creation.
Default value: false
Data type: Any
Specifies whether to grant the ability to create new databases with this role.
Default value: false
Data type: Any
Specifies whether to grant the ability to create new roles with this role.
Default value: false
Data type: Any
Database used to connect to.
Default value: $postgresql::server::default_database
Data type: Any
Port to use when connecting.
Default value: undef
Data type: Any
Specifies whether to grant login capability for the new role.
Default value: true
Data type: Any
Specifies whether to grant inherit capability for the new role.
Default value: true
Data type: Any
Specifies whether to grant super user capability for the new role.
Default value: false
Data type: Any
Provides provides replication capabilities for this role if set to true.
Default value: false
Data type: Any
Specifies how many concurrent connections the role can make. Default value: '-1', meaning no limit.
Default value: '-1'
Data type: Any
Defines the username of the role to create.
Default value: $title
Data type: Any
Specifies a hash of environment variables used when connecting to a remote server.
Default value: $postgresql::server::default_connect_settings
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'
Data type: Any
Sets the OS user to run psql
Default value: $postgresql::server::user
Data type: Any
Sets the OS group to run psql
Default value: $postgresql::server::group
Data type: Any
Sets path to psql command
Default value: $postgresql::server::psql_path
Data type: Any
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
Create a new schema.
- Note The database must exist and the PostgreSQL user should have enough privileges
postgresql::server::schema {'private':
db => 'template1',
}
The following parameters are available in the postgresql::server::schema
defined type:
Data type: Any
Required. Sets the name of the database in which to create this schema.
Default value: $postgresql::server::default_database
Data type: Any
Sets the default owner of the schema.
Default value: undef
Data type: Any
Sets the name of the schema.
Default value: $title
Data type: Any
Specifies a hash of environment variables used when connecting to a remote server.
Default value: $postgresql::server::default_connect_settings
This resource wraps the grant resource to manage table grants specifically.
The following parameters are available in the postgresql::server::table_grant
defined type:
Data type: Any
Specifies comma-separated list of privileges to grant. Valid options: 'ALL', 'SELECT', 'INSERT', 'UPDATE', 'DELETE', 'TRUNCATE', 'REFERENCES', 'TRIGGER'.
Data type: Any
Specifies the table to which you are granting access.
Data type: Any
Specifies which database the table is in.
Data type: Any
Specifies the role or user to whom you are granting access.
Data type: Any
Specifies whether to grant or revoke the privilege. Default is to grant the privilege.
Default value: undef
Data type: Any
Port to use when connecting.
Default value: undef
Data type: Any
Specifies the database to execute the grant against. This should not ordinarily be changed from the default.
Default value: undef
Data type: Any
Specifies the OS user for running psql.
Default value: undef
Data type: Any
Specifies a hash of environment variables used when connecting to a remote server.
Default value: undef
Data type: Any
Create grant only if it doesn't exist.
Default value: false
This module creates tablespace.
The following parameters are available in the postgresql::server::tablespace
defined type:
Data type: Any
Specifies the path to locate this tablespace.
Data type: Any
Set to false if you have file{ $location: } already defined
Default value: true
Data type: Any
Specifies the default owner of the tablespace.
Default value: undef
Data type: Any
Specifies the name of the tablespace.
Default value: $title
Data type: Any
Specifies a hash of environment variables used when connecting to a remote server.
Default value: $postgresql::server::default_connect_settings
This validated if the postgres connection can be established between the node on which this resource is run and a specified postgres instance (host/port/user/password/database name).
The following parameters are available in the postgresql::validate_db_connection
defined type:
database_host
database_name
database_password
database_username
database_port
connect_settings
run_as
sleep
tries
create_db_first
Data type: Any
Database host address
Default value: undef
Data type: Any
Specifies the name of the database you wish to test.
Default value: undef
Data type: Any
Specifies the password to connect with.
Default value: undef
Data type: Any
Specifies the username to connect with.
Default value: undef
Data type: Any
Defines the port to use when connecting.
Default value: undef
Data type: Any
Specifies a hash of environment variables used when connecting to a remote server.
Default value: undef
Data type: Any
Specifies the user to run the psql command as.
Default value: undef
Data type: Any
Sets the number of seconds to sleep for before trying again after a failure.
Default value: 2
Data type: Any
Sets the number of attempts after failure before giving up and failing the resource.
Default value: 10
Data type: Any
Creates the database when obtaining a successful connection.
Default value: true
This type allows puppet to manage postgresql.conf parameters.
The following properties are available in the postgresql_conf
type.
Valid values: present
, absent
The basic property that the resource should be in.
Default value: present
The path to postgresql.conf
The value to set for this parameter.
The following parameters are available in the postgresql_conf
type.
Valid values: %r{^[\w\.]+$}
namevar
The postgresql parameter name to manage.
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.
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.
The following properties are available in the postgresql_conn_validator
type.
Valid values: present
, absent
Ensure connection validation
Default value: present
The following parameters are available in the postgresql_conn_validator
type.
command
connect_settings
db_name
db_password
db_username
host
name
port
provider
psql_path
run_as
sleep
tries
Command to run against target database.
Default value: SELECT 1
Hash of environment variables for connection to a db.
The name of the database you are trying to validate a connection with.
The password required to access the target PostgreSQL database.
A user that has access to the target PostgreSQL database.
The DNS name or IP address of the server where PostgreSQL should be running.
namevar
An arbitrary name used as the identity of the resource.
The port that the PostgreSQL server should be listening on.
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.
Path to the psql command.
System user that will run the psql command.
The length of sleep time between connection tries.
Default value: 2
The number of tries to validate the connection to the target PostgreSQL database.
Default value: 10
An arbitrary tag for your own reference; the name of the message.
The following properties are available in the postgresql_psql
type.
The SQL command to execute via psql.
The following parameters are available in the postgresql_psql
type.
connect_settings
cwd
db
environment
name
onlyif
port
provider
psql_group
psql_path
psql_user
refreshonly
search_path
sensitive
unless
Connection settings that will be used when connecting to postgres
The working directory under which the psql command should be executed.
Default value: /tmp
The name of the database to execute the SQL command against, this overrides any PGDATABASE value in connect_settings
Any additional environment variables you want to set for a SQL command. Multiple environment variables should be specified as an array.
namevar
An arbitrary tag for your own reference; the name of the message.
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.
The port of the database server to execute the SQL command against, this overrides any PGPORT value in connect_settings.
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.
The system user group account under which the psql command should be executed.
Default value: postgres
The path to psql executable.
Default value: psql
The system user account under which the psql command should be executed.
Default value: postgres
Valid values: true
, false
If 'true', then the SQL will only be executed via a notify/subscribe event.
Default value: false
The schema search path to use when executing the SQL command
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
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.'
This type allows to create and destroy replication slots to register warm standby replication on a Postgresql primary server.
The following properties are available in the postgresql_replication_slot
type.
Valid values: present
, absent
The basic property that the resource should be in.
Default value: present
The following parameters are available in the postgresql_replication_slot
type.
Valid values: %r{^[a-z0-9_]+$}
namevar
The name of the slot to create. Must be a valid replication slot name.
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.
Type: Puppet Language
This function pull default values from the params
class or globals
class if the value is not present in params
.
postgresql::default('variable')
The postgresql::default function.
Returns: Any
postgresql::default('variable')
Data type: String
Type: Ruby 4.x API
This function escapes a string using Dollar Quoting using a randomly generated tag if required.
The postgresql::postgresql_escape function.
Returns: String
A Dollar Quoted
string
Data type: String[1]
The unescaped string you want to escape using dollar quoting
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],Integer] $password)
The postgresql::postgresql_password function.
Returns: String
The postgresql password hash from the clear text username / password.
Data type: Variant[String[1],Integer]
The clear text username
Data type: Variant[String[1],Integer]
The clear text password
Type: Ruby 4.x API
DEPRECATED. Use the namespaced function postgresql::postgresql_escape
instead.
The postgresql_escape function.
Returns: Any
Data type: Any
Type: Ruby 4.x API
DEPRECATED. Use the namespaced function postgresql::postgresql_password
instead.
The postgresql_password function.
Returns: Any
Data type: Any
Allows you to execute arbitary SQL
Supports noop? false
Data type: Optional[String[1]]
Database to connect to
Data type: Optional[String[1]]
Hostname to connect to
Data type: Optional[String[1]]
The password
Data type: Optional[String[1]]
The port
Data type: String[1]
The SQL you want to execute
Data type: Optional[String[1]]
The user