All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org).
- service\_ensure =\> true is now an allowed value \(aliased to running\) [\#1167](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1167) ([binford2k](https://github.com/binford2k))
- Finish conversion of `postgresql\_acls\_to\_resources\_hash` function [\#1163](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1163) ([alexjfisher](https://github.com/alexjfisher))
- Finish conversion of `postgresql\_escape` function [\#1162](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1162) ([alexjfisher](https://github.com/alexjfisher))
- Finish conversion of `postgresql\_password` function [\#1161](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1161) ([alexjfisher](https://github.com/alexjfisher))
- Allow usage of grant and role when not managing postgresql::server [\#1159](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1159) ([tuxmea](https://github.com/tuxmea))
- Add version configs for SLES 12 SP 3 to 5 [\#1158](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1158) ([XnS](https://github.com/XnS))
- Add extra parameter "extra\_systemd\_config" [\#1156](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1156) ([veninga](https://github.com/veninga))
### Fixed
- \(MODULES-10610\) Use correct lower bound for concat version [\#1160](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1160) ([ghoneycutt](https://github.com/ghoneycutt))
- feat: enable different database resource name in extension [\#1136](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1136) ([jfroche](https://github.com/jfroche))
- pdksync - \(FM-8581\) - Debian 10 added to travis and provision file refactored [\#1130](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1130) ([david22swan](https://github.com/david22swan))
- Fix incorrectly quoted GRANT cmd on functions [\#1150](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1150) ([olifre](https://github.com/olifre))
- Correct versioncmp logic in config.pp [\#1137](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1137) ([boydtom](https://github.com/boydtom))
- Treat $version as an integer for comparison, defaults to string [\#1135](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1135) ([boydtom](https://github.com/boydtom))
- Allow usage of PUBLIC role [\#1134](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1134) ([Vampouille](https://github.com/Vampouille))
- fix missing systemd override config for EL8 \(CentOS and RHEL\) [\#1131](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1131) ([david-barbion](https://github.com/david-barbion))
- Add support for granting privileges on functions [\#1118](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1118) ([crispygoth](https://github.com/crispygoth))
- \(FM-8679\) - Support added for CentOS 8 [\#1117](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1117) ([david22swan](https://github.com/david22swan))
- MODULES-10041 - allow define password\_encryption for version above 10 [\#1111](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1111) ([k2patel](https://github.com/k2patel))
### Fixed
- Remove duplicate REFERENCE.md file with strange unicode character at end of filename [\#1108](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1108) ([nudgegoonies](https://github.com/nudgegoonies))
- \(FM-7500\) conversion to use litmus [\#1081](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1081) ([tphoney](https://github.com/tphoney))
### Fixed
- \(MODULES-9658\) - custom ports are not labeled correctly [\#1099](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1099) ([blackknight36](https://github.com/blackknight36))
- Fix: When assigning a tablespace to a database, no equal sign is needed in the query [\#1098](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1098) ([biertie](https://github.com/biertie))
- Grant all tables in schema fixup [\#1096](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1096) ([georgehansper](https://github.com/georgehansper))
- \(MODULES-9219\) - puppetlabs-postgresql : catalog compilation fails when the service command is not installed [\#1093](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1093) ([blackknight36](https://github.com/blackknight36))
- Include EL8 version for config checks [\#1060](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1060) ([ehelms](https://github.com/ehelms))
### Fixed
- Support current version of puppetlabs/apt. [\#1073](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1073) ([pillarsdotnet](https://github.com/pillarsdotnet))
- change username/group/datadir defaults for FreeBSD [\#1063](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1063) ([olevole](https://github.com/olevole))
- \(FM-7811\) - Use postgresql 9.4 for SLES 11 sp4 [\#1057](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1057) ([david22swan](https://github.com/david22swan))
- \(MODULES-8553\) Further cleanup for package tag issues [\#1055](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1055) ([HelenCampbell](https://github.com/HelenCampbell))
- \(MODULES-3804\) Fix sort order of pg\_hba\_rule entries [\#1040](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1040) ([olavmrk](https://github.com/olavmrk))
### Fixed
- \(MODULES-8553\) Fix dependency on apt by explicitly using 'puppetlabs-postgresql' as tag [\#1052](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1052) ([HelenCampbell](https://github.com/HelenCampbell))
- \(MODULES-8352\) Don't use empty encoding string on initdb [\#1043](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1043) ([binford2k](https://github.com/binford2k))
- Add postgis support for postgres 10 [\#1032](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1032) ([smussie](https://github.com/smussie))
### Fixed
- Strip quotes from role names [\#1034](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1034) ([jstuart](https://github.com/jstuart))
- Ignore .psqlrc so output is clean and doesn't break Puppet [\#1021](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1021) ([flaviogurgel](https://github.com/flaviogurgel))
- Change initdb option '--xlogdir' to '-X' for PG10 compatibility [\#976](https://github.com/puppetlabs/puppetlabs-postgresql/pull/976) ([fcanovai](https://github.com/fcanovai))
- metadata.json: bump allowed version of puppetlabs-apt to 6.0.0 [\#1012](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1012) ([mateusz-gozdek-sociomantic](https://github.com/mateusz-gozdek-sociomantic))
- \(MODULES-7479\) Update postgresql to support Ubuntu 18.04 [\#1005](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1005) ([david22swan](https://github.com/david22swan))
- \(MODULES-7479\) Ensure net-tools is installed when testing on Ubuntu 18.04 [\#1006](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1006) ([david22swan](https://github.com/david22swan))
- \(MODULES-7460\) - Updating grant table to include INSERT privileges [\#1004](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1004) ([pmcmaw](https://github.com/pmcmaw))
- Fix packages choice for ubuntu 17.10 [\#1000](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1000) ([fflorens](https://github.com/fflorens))
- Fix creation of recovery.conf file when recovery configuration is not specified [\#995](https://github.com/puppetlabs/puppetlabs-postgresql/pull/995) ([cdloh](https://github.com/cdloh))
### Added
- Add compatibility for Fedora 28 [\#994](https://github.com/puppetlabs/puppetlabs-postgresql/pull/994) ([jflorian](https://github.com/jflorian))
- Adding default Postgresql version for Ubuntu 18.04 [\#981](https://github.com/puppetlabs/puppetlabs-postgresql/pull/981) ([lutaylor](https://github.com/lutaylor))
### Fixed
- Fix quoting on schema owners [\#979](https://github.com/puppetlabs/puppetlabs-postgresql/pull/979) ([hasegeli](https://github.com/hasegeli))
- Parameters `roles`, `config\_entires`, and `pg\_hba\_rules` to `postgresql::server` for hiera [\#950](https://github.com/puppetlabs/puppetlabs-postgresql/pull/950) ([ekohl](https://github.com/ekohl))
- Parameter `ensure` on `postgresql::server::grant` and `postgresql::server::database\_grant` [\#891](https://github.com/puppetlabs/puppetlabs-postgresql/pull/891) ([georgehansper](https://github.com/georgehansper))
### Fixed
- Documentation error, `reassign\_owned\_by` uses `\*\_role` not `\*\_owner`. [\#958](https://github.com/puppetlabs/puppetlabs-postgresql/pull/958) ([computermouth](https://github.com/computermouth))
## 5.3.0
### Summary
Implements rubocop changes within the module, alongside other smaller changes.
#### Added
- ensure=>absent added to postgresql::server:role.
- Support added for Fedora 27.
- scram-sha-256 added as a valid ph_hba_rule auth method.
- 9.6 settings inherited for later PgSQL versions on FreeBSD.
- A require has been added for puppet.
#### Changed
- Changes made to avoid the useless loading of files by augeas.
- Modulesync changes.
- psql_path defaulted to postgresql::server::psql_path.
- Rubocop changes have been made.
#### Removed
- Debian 9 support deprecated.
## Supported Release 5.2.1
### Summary
Bug fix for issue introduced in 5.2.0
#### Fixed
- issue where the module was attempting to install extensions before a database was available. ([SERVER-2003](https://tickets.puppetlabs.com/browse/SERVER-2003))
## Supported Release 5.2.0
### Summary
Adds several new features including some work around OS support. Also includes a couple of fixes to tests and the removal of unsupported Ubuntu versions.
#### Added
- Added default postgresql version of Ubuntu 17.4 version to the globals.pp file.
- Fedora 26 provides postgresql-server version 9.6 by default - Added support to manifests/globals.pp to avoid puppet failures on Fedora 26 nodes.
- Use postgresql 9.6 for the newest SLES and openSUSE releases.
- Enhanced --data-checksums on initdb.
- Added support for Debian version 9.
- Added a `version` parameter.
#### Changed
- Replaced validate_re calls with puppet datatype `Pattern` and is_array calls with puppet datatype `Array`.
- Installation method for apt in the spec_helper_acceptance, this is a temporary workaround due to issues with module installation.
#### Fixed
- Updated spec tests to remove deprecation warnings.
- Docs formatting.
- Pass default_connect_settings to validate service ([MODULES-4682](https://tickets.puppetlabs.com/browse/MODULES-4682))
- Rocket Alignment for Lint.
- Fixed changes in error messages in tests ([MODULES-5378](https://tickets.puppetlabs.com/browse/MODULES-5378))
#### Removed
- Removed unsupported Ubuntu versions 10.04 and 12.04 ([MODULES-5501](https://tickets.puppetlabs.com/browse/MODULES-5501))
- Removed unsupported Debian version 6.
- Removed numeric order override.
## Supported Release 5.1.0
### Summary
This release includes Japanese translations for internationalization, Puppet 5 support, implementation of defined type postgresql::server::reassign_owned_by.
#### Features
- Updating translations for readmes/README_ja_JP.md
- add defined type postgresql::server::reassign_owned_by
- Allow order parameter to be string value
- prep for puppet 5 ([MODULES-5144](https://tickets.puppetlabs.com/browse/MODULES-5144))
- add data_checksums option to initdb
- parameter ensure of custom resource postgresql_replication_slot is not documented ([MODULES-2989](https://tickets.puppetlabs.com/browse/MODULES-2989))
#### Bug Fixes
- Adding a space for header formatting
- use https for apt.postgresql.org repo
- msync puppet 5 and ruby 2.4 ([MODULES-5197](https://tickets.puppetlabs.com/browse/MODULES-5187))
- Only run test on postgresql >= 9.0 ([FM-6240](https://tickets.puppetlabs.com/browse/FM-6240))
- Fix Ruby 2.4 deprecation in postgresql_acls_to_resources_hash
## Supported Release 5.0.0
### Summary
This **major** release dropped support for Puppet 3 and PostgreSQL 8.x, added Puppet 4 data types, and deprecated the validate_db_connection type.
#### Added
- `locales/` directory, .pot file, and i18n `config.yaml`. ([FM-6116](https://tickets.puppet.com/browse/FM-6116))
- `update_password` parameter to toggle password management per role.
- **Puppet 4** type validation.
- new `postgresql_conn_validator` custom type and deprecated `validate_db_connection`. ([MODULES-1394](https://tickets.puppet.com/browse/MODULES-1394))
#### Changed
- default postgis versions in postgresql::globals to use newer versions.
- puppetlabs-concat and puppetlabs-apt dependencies to use latest versions. ([MODULES-4906](https://tickets.puppet.com/browse/MODULES-4906), [MODULES-4947](https://tickets.puppet.com/browse/MODULES-4947))
- default value for `log_line_prefix` to `undef`.
- `listen_addresses` default value to 'localhost'. Allows for it to be set independently of a class declaration.
- use of stdlib validate_* functions. They have been removed in favor of Puppet 4 type validation.
- lower Puppet dependency in metadata to 4.7.0. ([MODULES-4826](https://tickets.puppet.com/browse/MODULES-4826))
This release adds several types and, among other bugs, fixes an issue with the yum URL.
#### Features
- Modifying ownership of databases and schemas now available (MODULES-3247)
- Use `module_workdir` to specify a custom directory in which to execute psql commands
- `grant_role` and `grant` types added!
- Support for parallel unit testing (parallel_tests)
- Override download/installation repo URL with `repo_baseurl`
- Set your timezone with `timezone`
- Grant privileges on LANGUAGEs
- Added support for Debian Stretch and Ubuntu Yakkety Yak
#### Bugfixes
- Usernames and passwords are now converted to strings before password hash is created
- Specify default database name if it is not the username
- Update to yum repo
- Schema name conflicts fix
## Supported Release 4.8.0
### Summary
This release primarily fixes an issue with `postgresql_conf` values of ipaddresses being considered floats and not getting quoted.
#### Features
- Add `default_connect_settings` parameter to `postgresql::server`
- Running under strict variables is now supported
- Add timestamps into logs by default
#### Bugfixes
- Obscure password in postgresql\_psql type
- Fix ip address quoting in postgresql\_conf type
- Fix handling of systemd service on Ubuntu
- Mark log_min_duration_statement setting as requiring a service restart
- Add fixes for Fedora 23, Fedora 24, FreeBSD, OpenBSD
- Fix environment handling to avoid "Overriding environment setting" message
- Work around PUP-6385, using empty arrays instead of undef when specifying resource relationships
- README editorial pass
- Reduce whitespace in templates
- Update build/test infrastructure
## Supported Release 4.7.1
### Summary
This release contains some bugfixes and documentation updates.
#### Bugfixes
- (MODULES-3024) Quote database objects when creating databases.
- Properly escape case where password ends with '$'.
- Fixes password change when postgres is configure to non-standard port.
- Unpins concat dependency to be able to use concat 2.x.
- Workaround to fix installing on Amazon Linux.
- Fixes proper defaulting of `$service_provider` parameter.
- Fixes postgres server init script naming on Amazon Linux.
- Fixes service reload parameter on Arch Linux.
- Adds missing onlyif_function to sequence grant code.
- Fixes to the markdown of the README.
## Supported Release 4.7.0
### Summary
A release with a considerable amount of new features, including remote db support and several platform support updates. Various bugfixes including several to address warnings and a sizable README update.
#### Features
- Remote DB support - Connection-settings allows a hash of options that can be used when connecting to a remote DB.
- Debian 8 support.
- Updated systemd-override to support fedora and CentOS paths.
- Adds the ability to define the extension name separately from the title of the resource, which allows you to add the extension to more than one database.
- Added parameter to disable automatic service restarts on config changes.
- Ubuntu 15.10 compatibility.
- OpenBSD version is now 9.4.
- Added .gitattributes to maintain line endings for .sh and .rb files.
- Adds default postgis version for 9.5.
- Allows float postgresql_conf values.
- Schedule apt update after install of repo.
#### Bugfixes
- Fixed systemd-override for RedHat systems with unmanaged Yum repos.
- Removed inherits postgresql::params.
- Multi-node tests are now not ran by default.
- Change apt::pin to apt_postgresql_org to prevent error message.
- Removed syntax error near UTF8.
- Removal of extra blanks and backslashes in README.
- Double quotes now used around database name to prevent syntax error.
- Removes ruby 1.8.7 and puppet 2.7 from travis-ci jobs.
- Fixed paths to work on Amazon Linux.
- Fixed quotes around locale options.
- Huge README update.
- Update to use current msync configs.
- Fixes postgresql::server acceptance test descriptions.
## Supported Release 4.6.1
###Summary
Small release for support of newer PE versions. This increments the version of PE in the metadata.json file.
## 2015-09-01 - Supported Release 4.6.0
### Summary
This release adds a proxy feature for yum, Postgis improvements, and decoupling pg_hba_rule from postgresql::server.
#### Features
- Support setting a proxy for yum operations
- Allow for undefined PostGIS version
- Decouple pg_hba_rule from postgresql::server
#### Bugfixes
- Fix postgis default package name on RedHat
## 2015-07-27 - Supported Release 4.5.0
### Summary
This release adds sequence grants, some postgresql 9.4 fixes, and `onlyif` to
the psql resource.
### Features
- Add `onlyif` parameter to `postgresql_psql`
- Add unsupported compatibility with Ubuntu 15.04
- Add unsupported compatibility with SLES 11/12 and OpenSuSE 13.2
- Fix systemd override for manage_repo package versions
- Fix Copy snakeoil certificate and key instead of symlinking
#### Test Improvements
- Allows setting BEAKER and BEAKER_RSPEC versions via environment variables.
- Enables Unit testing on Travis CI with Puppet 4.
- Cleans up spec_helper_acceptance.rb to use new puppet_install_helper gem.
## 2015-03-24 - Supported Release 4.3.0
### Summary
This release fixes compatibility with Puppet 4 and removes opportunities for local users to view the postgresql password. It also adds a new custom resource to aid in managing replication.
#### Features
- Add `postgresql::server::logdir` parameter to manage the logdir
- Add `environment` parameter to `postgresql_psql`
- Don't print postgresql\_psql password in command
- Allow `postgresql::validate_db_connection` for more than one host+port+database combo
- Fix service command on Debian 8 and up
- Fix `postgresql::server::extension` to work with custom user/group/port
- Fix `postgresql::server::initdb` to work with custom user/group/port
- Fix changing template1 encoding
- Fix default `postgresql::server::grant::object_name` value
- Fix idempotency of granting all tables in schema with `puppet::server::grant`
- Fix lint warnings
- Fix apt key to use 40 character key and bump puppetlabs-apt to >= 1.8.0 < 2.0.0
##2015-03-10 - Supported Release 4.2.0
###Summary
This release has several new features including support for server extensions, improved grant support, and a number of bugfixes.
####Features
- Changes to support OpenBSD
- Add `service_reload` parameter to `postgresql::server`
- Add `comment` parameter to `postgresql::server::database` (MODULES-1153)
- Add `postgresql::server::extension` defined type
- Add postgresql versions for utopic and jessie
- Update `postgresql::server::grant` to support 'GRANT SCHEMA' and 'ALL TABLES IN SCHEMA'
####Bugfixes
- Lint cleanup
- Remove outdated upgrade info from README
- Use correct TCP port when checking password
- Create role before database
- Fix template1 encoding on Debian
- Require server package before user permissions
- Fix `service_status` default for FreeBSD to allow PostgreSQL to start the first run
- Fix invalid US-ASCII byte sequence in `postgresql::server::grant` comments
- Reverted to default behavior for Debian systems as `pg_config` should not be overwritten (MODULES-1485)
##2014-11-04 - Supported Release 4.1.0
###Summary
This release adds the ability to change the PGDATA directory, and also includes documentation and test updates, future parser support, and a few other new features.
####Features
- Future parser support
- Documentation updates
- Test updates
- Add a link from `/etc/sysconfig/pgsql/postgresql-${version}` to `/etc/sysconfig/pgsql/postgresql` to support init scripts from the postgresql.org repo
- Add support for changing the PGDATA directory
- Set default versions for Fedora 21 and FreeBSD
##2014-09-03 - Supported Release 4.0.0
###Summary
This release removes the uninstall ability from the module, removes the firewall
management, overhauls all of the acceptance testing, as well as adds better
support for SuSE and Fedora.
###Backwards Incompatible changes.
- Uninstall code removal.
- Firewall management for Postgres.
- Set manage_pg_ident_conf to true.
####Uninstallation removal
We rely heavily on the ability to uninstall and reinstall postgres throughout
our testing code, testing features like "can I move from the distribution
packages to the upstream packages through the module" and over time we've
learnt that the uninstall code simply doesn't work a lot of the time. It
leaves traces of postgres behind or fails to remove certain packages on Ubuntu,
and generally causes bits to be left on your system that you didn't expect.
When we then reinstall things fail because it's not a true clean slate, and
this causes us enormous problems during test. We've spent weeks and months
working on these tests and they simply don't hold up well across the full range
of PE platforms.
Due to all these problems we've decided to take a stance on uninstalling in
general. We feel that in 2014 it's completely reasonable and normal to have a
good provisioning pipeline combined with your configuration management and the
"correct" way to uninstall a fully installed service like postgresql is to
simply reprovision the server without it in the first place. As a general rule
this is how I personally like to work and I think is a good practice.
####I'm not OK with this!
We understand that there are environments and situations in which it's not easy
to do that. What if you accidently deployed Postgres on 100,000 nodes? In the
future we're going to take a look at building some example 'profiles' to be
found under examples/ within this module that can uninstall postgres on popular
platforms. These can be modified and used in your specific case to uninstall
postgresql. They will be much more brute force and reliant on deleting entire
directories and require you to do more work up front in specifying where things
are installed but we think it'll prove to be a much cleaner mechanism for this
kind of thing rather than trying to weave it into the main module logic itself.
####Features
- Removal of uninstall.
- Removal of firewall management.
- Tests ported to rspec3.
- Acceptance tests rewritten.
- Add a defined type for creating database schemas.
- Add a pg_ident_rule defined type.
- Set manage_pg_ident_conf to true.
- Manage pg_ident.conf by default.
- Improve selinux support for tablespace.
- Remove deprecation warnings.
- Support changing PGDATA on RedHat.
- Add SLES 11 support.
####Bugfixes
- Link pg_config binary into /usr/bin.
- Fix fedora support by using systemd.
- Initdb should create xlogdir if set.
- Use a regular expression to match the major OS version on Ubuntu.
##2014-07-31 - Supported Release 3.4.2
###Summary
This release fixes recent Fedora versions.
####Features
####Bugfixes
- Fix Fedora.
##2014-07-15 - Supported Release 3.4.1
###Summary
This release merely updates metadata.json so the module can be uninstalled and
upgraded via the puppet module command.
##2014-04-14 - Supported Release 3.4.0
###Summary
This feature rolls up several important features, the biggest being PostGIS
handling and allowing `port` to be set on postgresql::server in order to
change the port that Postgres listens on. We've added support for RHEL7
and Ubuntu 14.04, as well as allowing you to manage the service via
`service_ensure` finally.
####Features
- Added `perl_package_name` for installing bindings.
- Added `service_ensure` for allowing control of services.
- Added `postgis_version` and postgis class for installing postgis.
- Added `port` for selecting the port Postgres runs on.
- Add support for RHEL7 and Ubuntu 14.04.
- Add `default_db` to postgresql::server::database.
- Widen the selection of unquoted parameters in postgresql_conf{}
- Require the service within postgresql::server::reload for RHEL7.
- Add `inherit` to postgresql::server::role.
####Bugfixes
##2014-03-04 - Supported Release 3.3.3
###Summary
This is a supported release. This release removes a testing symlink that can
cause trouble on systems where /var is on a seperate filesystem from the
modulepath.
####Features
####Bugfixes
####Known Bugs
* SLES is not supported.
##2014-03-04 - Supported Release 3.3.2
###Summary
This is a supported release. It fixes a problem with updating passwords on postgresql.org distributed versions of PostgreSQL.
####Bugfixes
- Correct psql path when setting password on custom versions.
- Documentation updates
- Test updates
####Known Bugs
* SLES is not supported.
##2014-02-12 - Version 3.3.1
####Bugfix:
- Allow dynamic rubygems host
##2014-01-28 - Version 3.3.0
###Summary
This release rolls up a bunch of bugfixes our users have found and fixed for
us over the last few months. This improves things for 9.1 users, and makes
this module usable on FreeBSD.
This release is dedicated to 'bma', who's suffering with Puppet 3.4.1 issues
thanks to Puppet::Util::SUIDManager.run_and_capture.
####Features
- Add lc_ config entry settings
- Can pass template at database creation.
- Add FreeBSD support.
- Add support for customer `xlogdir` parameter.
- Switch tests from rspec-system to beaker. (This isn't really a feature)
####Bugfixes
- Properly fix the deprecated Puppet::Util::SUIDManager.run_and_capture errors.
- Add $postgresql::server::client_package_name, referred to by install.pp
- Add missing service_provider/service_name descriptions in ::globals.
- Fix several smaller typos/issues throughout.
- Exec['postgresql_initdb'] needs to be done after $datadir exists
- Prevent defined resources from floating in the catalog.
- Fix granting all privileges on a table.
- Add some missing privileges.
- Remove deprecated and unused concat::fragment parameters.
##2013-11-05 - Version 3.2.0
###Summary
Add's support for Ubuntu 13.10 (and 14.04) as well as x, y, z.
####Features
- Add versions for Ubuntu 13.10 and 14.04.
- Use default_database in validate_db_connection instead of a hardcoded
'postgres'
- Add globals/params layering for default_database.
- Allow specification of default database name.
####Bugs
- Fixes to the README.
##2013-10-25 - Version 3.1.0
###Summary
This is a minor feature and bug fix release.
Firstly, the postgresql_psql type now includes a new parameter `search_path` which is equivalent to using `set search_path` which allows you to change the default schema search path.
The default version of Fedora 17 has now been added, so that Fedora 17 users can enjoy the module.
And finally we've extended the capabilities of the defined type postgresql::validate_db_connection so that now it can handle retrying and sleeping between retries. This feature has been monopolized to fix a bug we were seeing with startup race conditions, but it can also be used by remote systems to 'wait' for PostgreSQL to start before their Puppet run continues.
####Features
- Defined $default_version for Fedora 17 (Bret Comnes)
- add search_path attribute to postgresql_psql resource (Jeremy Kitchen)
- (GH-198) Add wait and retry capability to validate_db_connection (Ken Barber)
####Bugs
- enabling defined postgres user password without resetting on every puppet run (jonoterc)
- periods are valid in configuration variables also (Jeremy Kitchen)
- Add zero length string to join() function (Jarl Stefansson)
- add require of install to reload class (cdenneen)
- (GH-198) Fix race condition on postgresql startup (Ken Barber)
- Remove concat::setup for include in preparation for the next concat release (Ken Barber)
##2013-10-14 - Version 3.0.0
Final release of 3.0, enjoy!
##2013-10-14 - Version 3.0.0-rc3
###Summary
Add a parameter to unmanage pg_hba.conf to fix a regression from 2.5, as well
as allowing owner to be passed into x.
####Features
- `manage_pg_hba_conf` parameter added to control pg_hba.conf management.
- `owner` parameter added to server::db.
##2013-10-09 - Version 3.0.0-rc2
###Summary
A few bugfixes have been found since -rc1.
####Fixes
- Special case for $datadir on Amazon
- Fix documentation about username/password for the postgresql_hash function
##2013-10-01 - Version 3.0.0-rc1
###Summary
Version 3 was a major rewrite to fix some internal dependency issues, and to
make the new Public API more clear. As a consequence a lot of things have
changed for version 3 and older revisions that we will try to outline here.
(NOTE: The format of this CHANGELOG differs to normal in an attempt to
explain the scope of changes)
* Server specific objects now moved under `postgresql::server::` namespace:
To restructure server specific elements under the `postgresql::server::`
namespaces the following objects were renamed as such:
If you were using `file_line` for this purpose, you should change to this new
methodology.
* `postgresql_puppet_extras.conf` has been removed:
Now that we have a methodology for managing `postgresql.conf`, and due to
concerns over the file management methodology using an `exec { 'touch ...': }`
as a way to create an empty file the existing postgresql\_puppet\_extras.conf
file is no longer managed by this module.
If you wish to recreate this methodology yourself, use this pattern:
```puppet
class { 'postgresql::server': }
$extras = "/tmp/include.conf"
file { $extras:
content => 'max_connections = 123',
notify => Class['postgresql::server::service'],
}->
postgresql::server::config_entry { 'include':
value => $extras,
}
```
* All uses of the parameter `charset` changed to `encoding`:
Since PostgreSQL uses the terminology `encoding` not `charset` the parameter
has been made consisent across all classes and resources.
* The `postgresql` base class is no longer how you set globals:
The old global override pattern was less then optimal so it has been fixed,
however we decided to demark this properly by specifying these overrides in
the class `postgresql::global`. Consult the documentation for this class now
to see what options are available.
Also, some parameter elements have been moved between this and the
`postgresql::server` class where it made sense.
* `config_hash` parameter collapsed for the `postgresql::server` class:
Because the `config_hash` was really passing data through to what was in
effect an internal class (`postgresql::config`). And since we don't want this
kind of internal exposure the parameters were collapsed up into the
`postgresql::server` class directly.
* Lots of changes to 'private' or 'undocumented' classes:
If you were using these before, these have changed names. You should only use
what is documented in this README.md, and if you don't have what you need you
should raise a patch to add that feature to a public API. All internal classes
now have a comment at the top indicating them as private to make sure the
message is clear that they are not supported as Public API.
* `pg_hba_conf_defaults` parameter included to turn off default pg\_hba rules:
The defaults should be good enough for most cases (if not raise a bug) but if
you simply need an escape hatch, this setting will turn off the defaults. If
you want to do this, it may affect the rest of the module so make sure you
replace the rules with something that continues operation.
* `postgresql::database_user` has now been removed:
Use `postgresql::server::role` instead.
* `postgresql::psql` resource has now been removed:
Use `postgresql_psql` instead. In the future we may recreate this as a wrapper
to add extra capability, but it will not match the old behaviour.
* `postgresql_default_version` fact has now been removed:
It didn't make sense to have this logic in a fact any more, the logic has been
moved into `postgresql::params`.
* `ripienaar/concat` is no longer used, instead we use `puppetlabs/concat`:
The older concat module is now deprecated and moved into the
`puppetlabs/concat` namespace. Functionality is more or less identical, but
you may need to intervene during the installing of this package - as both use
the same `concat` namespace.
---
##2013-09-09 Release 2.5.0
###Summary
The focus of this release is primarily to capture the fixes done to the
types and providers to make sure refreshonly works properly and to set
the stage for the large scale refactoring work of 3.0.0.
####Features
####Bugfixes
- Use boolean for refreshonly.
- Fix postgresql::plperl documentation.
- Add two missing parameters to config::beforeservice
- Style fixes
##2013-08-01 Release 2.4.1
###Summary
This minor bugfix release solves an idempotency issue when using plain text
passwords for the password_hash parameter for the postgresql::role defined
type. Without this, users would continually see resource changes everytime
your run Puppet.
####Bugfixes
- Alter role call not idempotent with cleartext passwords (Ken Barber)
##2013-07-19 Release 2.4.0
###Summary
This updates adds the ability to change permissions on tables, create template
databases from normal databases, manage PL-Perl's postgres package, and
disable the management of `pg_hba.conf`.
####Features
- Add `postgresql::table_grant` defined resource
- Add `postgresql::plperl` class
- Add `manage_pg_hba_conf` parameter to the `postgresql::config` class
- Add `istemplate` parameter to the `postgresql::database` define
####Bugfixes
- Update `postgresql::role` class to be able to update roles when modified
instead of only on creation.
- Update tests
- Fix documentation of `postgresql::database_grant`
##2.3.0
This feature release includes the following changes:
* Add a new parameter `owner` to the `database` type. This can be used to
grant ownership of a new database to a specific user. (Bruno Harbulot)
* Add support for operating systems other than Debian/RedHat, as long as the
user supplies custom values for all of the required paths, package names, etc.
(Chris Price)
* Improved integration testing (Ken Barber)
##2.2.1
This release fixes a bug whereby one of our shell commands (psql) were not ran from a globally accessible directory. This was causing permission denied errors when the command attempted to change user without changing directory.
Users of previous versions might have seen this error:
Error: Error executing SQL; psql returned 256: 'could not change directory to "/root"
This patch should correct that.
#### Detail Changes
* Set /tmp as default CWD for postgresql_psql
##2.2.0
This feature release introduces a number of new features and bug fixes.
First of all it includes a new class named `postgresql::python` which provides you with a convenient way of install the python Postgresql client libraries.
class { 'postgresql::python':
}
You are now able to use `postgresql::database_user` without having to specify a password_hash, useful for different authentication mechanisms that do not need passwords (ie. cert, local etc.).
We've also provided a lot more advanced custom parameters now for greater control of your Postgresql installation. Consult the class documentation for PuppetDB in the README.
This release in particular has largely been contributed by the community members below, a big thanks to one and all.
#### Detailed Changes
* Add support for psycopg installation (Flaper Fesp and Dan Prince)
* Added default PostgreSQL version for Ubuntu 13.04 (Kamil Szymanski)
* Add ability to create users without a password (Bruno Harbulot)
* Three Puppet 2.6 fixes (Dominic Cleal)
* Add explicit call to concat::setup when creating concat file (Dominic Cleal)
* Fix readme typo (Jordi Boggiano)
* Update postgres_default_version for Ubuntu (Kamil Szymanski)
* Allow to set connection for noew role (Kamil Szymanski)
* Fix pg_hba_rule for postgres local access (Kamil Szymanski)
* Fix versions for travis-ci (Ken Barber)
* Add replication support (Jordi Boggiano)
* Cleaned up and added unit tests (Ken Barber)
* Generalization to provide more flexability in postgresql configuration (Karel Brezina)
* Create dependent directory for sudoers so tests work on Centos 5 (Ken Barber)
* Allow SQL commands to be run against a specific DB (Carlos Villela)
* Drop trailing comma to support Puppet 2.6 (Michael Arnold)
##2.1.1
This release provides a bug fix for RHEL 5 and Centos 5 systems, or specifically systems using PostgreSQL 8.1 or older. On those systems one would have received the error:
Error: Could not start Service[postgresqld]: Execution of ‘/sbin/service postgresql start’ returned 1:
This bug is due to a new feature we had added in 2.1.0, whereby the `include` directive in `postgresql.conf` was not compatible. As a work-around we have added checks in our code to make sure systems running PostgreSQL 8.1 or older do not have this directive added.
#### Detailed Changes
2013-01-21 - Ken Barber <ken@bob.sh>
* Only install `include` directive and included file on PostgreSQL >= 8.2
* Add system tests for Centos 5
##2.1.0
This release is primarily a feature release, introducing some new helpful constructs to the module.
For starters, we've added the line `include 'postgresql_conf_extras.conf'` by default so extra parameters not managed by the module can be added by other tooling or by Puppet itself. This provides a useful escape-hatch for managing settings that are not currently managed by the module today.
We've added a new defined resource for managing your tablespace, so you can now create new tablespaces using the syntax:
postgresql::tablespace { 'dbspace':
location => '/srv/dbspace',
}
We've added a locale parameter to the `postgresql` class, to provide a default. Also the parameter has been added to the `postgresql::database` and `postgresql::db` defined resources for changing the locale per database:
postgresql::db { 'mydatabase':
user => 'myuser',
password => 'mypassword',
encoding => 'UTF8',
locale => 'en_NG',
}
There is a new class for installing the necessary packages to provide the PostgreSQL JDBC client jars:
class { 'postgresql::java': }
And we have a brand new defined resource for managing fine-grained rule sets within your pg_hba.conf access lists:
postgresql::pg_hba { 'Open up postgresql for access from 200.1.2.0/24':
type => 'host',
database => 'app',
user => 'app',
address => '200.1.2.0/24',
auth_method => 'md5',
}
Finally, we've also added Travis-CI support and unit tests to help us iterate faster with tests to reduce regression. The current URL for these tests is here: https://travis-ci.org/puppetlabs/puppet-postgresql. Instructions on how to run the unit tests available are provided in the README for the module.
A big thanks to all those listed below who made this feature release possible :-).
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
diff --git a/REFERENCE.md b/REFERENCE.md
index e8e137b..c68d934 100644
--- a/REFERENCE.md
+++ b/REFERENCE.md
@@ -1,2909 +1,2917 @@
# Reference
<!-- DO NOT EDIT: This document was generated by Puppet Strings -->
## Table of Contents
**Classes**
_Public Classes_
* [`postgresql::client`](#postgresqlclient): Installs PostgreSQL client software. Set the following parameters if you have a custom version you would like to install.
* [`postgresql::globals`](#postgresqlglobals): Class for setting cross-class global overrides.
* [`postgresql::lib::devel`](#postgresqllibdevel): This class installs postgresql development libraries.
* [`postgresql::lib::docs`](#postgresqllibdocs): Installs PostgreSQL bindings for Postgres-Docs. Set the following parameters if you have a custom version you would like to install.
* [`postgresql::lib::java`](#postgresqllibjava): This class installs the postgresql jdbc connector.
* [`postgresql::lib::perl`](#postgresqllibperl): This class installs the perl libs for postgresql.
* [`postgresql::lib::python`](#postgresqllibpython): This class installs the python libs for postgresql.
* [`postgresql::server`](#postgresqlserver): This installs a PostgreSQL server
* [`postgresql::server::contrib`](#postgresqlservercontrib): Install the contrib postgresql packaging.
* [`postgresql::server::plperl`](#postgresqlserverplperl): This class installs the PL/Perl procedural language for postgresql.
* [`postgresql::server::plpython`](#postgresqlserverplpython): This class installs the PL/Python procedural language for postgresql.
* [`postgresql::server::postgis`](#postgresqlserverpostgis): Install the postgis postgresql packaging.
_Private Classes_
* `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::passwd`:
* `postgresql::server::reload`:
* `postgresql::server::service`:
**Defined types**
* [`postgresql::server::config_entry`](#postgresqlserverconfig_entry): Manage a postgresql.conf entry.
* [`postgresql::server::database`](#postgresqlserverdatabase): Define for creating a database.
* [`postgresql::server::database_grant`](#postgresqlserverdatabase_grant): Manage a database grant.
* [`postgresql::server::db`](#postgresqlserverdb): Define for conveniently creating a role, database and assigning the correctpermissions.
* [`postgresql::server::extension`](#postgresqlserverextension): Activate an extension on a postgresql database.
* [`postgresql::server::grant`](#postgresqlservergrant): Define for granting permissions to roles.
* [`postgresql::server::grant_role`](#postgresqlservergrant_role): Define for granting membership to a role.
* [`postgresql::server::pg_hba_rule`](#postgresqlserverpg_hba_rule): This resource manages an individual rule that applies to the file defined in target.
* [`postgresql::server::pg_ident_rule`](#postgresqlserverpg_ident_rule): This resource manages an individual rule that applies to the file defined in target.
* [`postgresql::server::reassign_owned_by`](#postgresqlserverreassign_owned_by): Define for reassigning the ownership of objects within a database.
* [`postgresql::server::recovery`](#postgresqlserverrecovery): This resource manages the parameters that applies to the recovery.conf template.
* [`postgresql::server::role`](#postgresqlserverrole): Define for creating a database role.
* [`postgresql::server::schema`](#postgresqlserverschema): Create a new schema.
* [`postgresql::server::table_grant`](#postgresqlservertable_grant): This resource wraps the grant resource to manage table grants specifically.
* [`postgresql::server::tablespace`](#postgresqlservertablespace): This module creates tablespace.
* [`postgresql::validate_db_connection`](#postgresqlvalidate_db_connection): This type validates that a successful postgres connection.
**Resource types**
* [`postgresql_conf`](#postgresql_conf): This type allows puppet to manage postgresql.conf parameters.
* [`postgresql_conn_validator`](#postgresql_conn_validator): Verify if a connection can be successfully established
* [`postgresql_psql`](#postgresql_psql): An arbitrary tag for your own reference; the name of the message.
* [`postgresql::default`](#postgresqldefault): This function pull default values from the `params` class or `globals` class if the value is not present in `params`.
* [`postgresql::postgresql_escape`](#postgresqlpostgresql_escape): This function escapes a string using [Dollar Quoting](https://www.postgresql.org/docs/12/sql-syntax-lexical.html#SQL-SYNTAX-DOLLAR-QUOTING) using a randomly generated tag if required.
* [`postgresql::postgresql_password`](#postgresqlpostgresql_password): This function returns the postgresql password hash from the clear text username / password
* [`postgresql_escape`](#postgresql_escape): DEPRECATED. Use the namespaced function [`postgresql::postgresql_escape`](#postgresqlpostgresql_escape) instead.
* [`postgresql_password`](#postgresql_password): DEPRECATED. Use the namespaced function [`postgresql::postgresql_password`](#postgresqlpostgresql_password) instead.
_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.
**Tasks**
* [`sql`](#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.
* **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: `Any`
Overrides the default PostgreSQL client package name.
Default value: `undef`
##### `server_package_name`
Data type: `Any`
Overrides the default PostgreSQL server package name.
Default value: `undef`
##### `contrib_package_name`
Data type: `Any`
Overrides the default PostgreSQL contrib package name.
Default value: `undef`
##### `devel_package_name`
Data type: `Any`
Overrides the default PostgreSQL devel package name.
Default value: `undef`
##### `java_package_name`
Data type: `Any`
Overrides the default PostgreSQL java package name.
Default value: `undef`
##### `docs_package_name`
Data type: `Any`
Overrides the default PostgreSQL docs package name.
Default value: `undef`
##### `perl_package_name`
Data type: `Any`
Overrides the default PostgreSQL Perl package name.
Default value: `undef`
##### `plperl_package_name`
Data type: `Any`
Overrides the default PostgreSQL PL/Perl package name.
Default value: `undef`
##### `plpython_package_name`
Data type: `Any`
Overrides the default PostgreSQL PL/Python package name.
Default value: `undef`
##### `python_package_name`
Data type: `Any`
Overrides the default PostgreSQL Python package name.
Default value: `undef`
##### `postgis_package_name`
Data type: `Any`
Overrides the default PostgreSQL PostGIS package name.
Default value: `undef`
##### `service_name`
Data type: `Any`
Overrides the default PostgreSQL service name.
Default value: `undef`
##### `service_provider`
Data type: `Any`
Overrides the default PostgreSQL service provider.
Default value: `undef`
##### `service_status`
Data type: `Any`
Overrides the default status check command for your PostgreSQL service.
Default value: `undef`
##### `default_database`
Data type: `Any`
Specifies the name of the default database to connect with.
Default value: `undef`
##### `validcon_script_path`
Data type: `Any`
Scipt path for the connection validation check.
Default value: `undef`
##### `initdb_path`
Data type: `Any`
Path to the initdb command.
Default value: `undef`
##### `createdb_path`
Data type: `Any`
Deprecated. Path to the createdb command.
Default value: `undef`
##### `psql_path`
Data type: `Any`
Sets the path to the psql command.
Default value: `undef`
##### `pg_hba_conf_path`
Data type: `Any`
Specifies the path to your pg_hba.conf file.
Default value: `undef`
##### `pg_ident_conf_path`
Data type: `Any`
Specifies the path to your pg_ident.conf file.
Default value: `undef`
##### `postgresql_conf_path`
Data type: `Any`
Sets the path to your postgresql.conf file.
Default value: `undef`
##### `recovery_conf_path`
Data type: `Any`
Path to your recovery.conf file.
Default value: `undef`
##### `default_connect_settings`
Data type: `Any`
Default connection settings.
Default value: {}
##### `pg_hba_conf_defaults`
Data type: `Any`
Disables the defaults supplied with the module for pg_hba.conf if set to false.
Default value: `undef`
##### `datadir`
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`
##### `confdir`
Data type: `Any`
Overrides the default PostgreSQL configuration directory for the target platform.
Default value: `undef`
##### `bindir`
Data type: `Any`
Overrides the default PostgreSQL binaries directory for the target platform.
Default value: `undef`
##### `xlogdir`
Data type: `Any`
Overrides the default PostgreSQL xlog directory.
Default value: `undef`
##### `logdir`
Data type: `Any`
Overrides the default PostgreSQL log directory.
Default value: `undef`
##### `log_line_prefix`
Data type: `Any`
Overrides the default PostgreSQL log prefix.
Default value: `undef`
##### `user`
Data type: `Any`
Overrides the default PostgreSQL super user and owner of PostgreSQL related files in the file system.
Default value: `undef`
##### `group`
Data type: `Any`
Overrides the default postgres user group to be used for related files in the file system.
Default value: `undef`
##### `version`
Data type: `Any`
The version of PostgreSQL to install and manage.
Default value: `undef`
##### `postgis_version`
Data type: `Any`
Defines the version of PostGIS to install, if you install PostGIS.
Default value: `undef`
##### `repo_proxy`
Data type: `Any`
Sets the proxy option for the official PostgreSQL yum-repositories only.
Default value: `undef`
##### `repo_baseurl`
Data type: `Any`
Sets the baseurl for the PostgreSQL repository. Useful if you host your own mirror of the repository.
Default value: `undef`
##### `needs_initdb`
Data type: `Any`
Explicitly calls the initdb operation after the server package is installed and before the PostgreSQL service is started.
Default value: `undef`
##### `encoding`
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`
##### `locale`
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_checksums`
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`
##### `timezone`
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`
##### `manage_pg_hba_conf`
Data type: `Any`
Allow Puppet to manage the pg_hba.conf file.
Default value: `undef`
##### `manage_pg_ident_conf`
Data type: `Any`
Allow Puppet to manage the pg_ident.conf file.
Default value: `undef`
##### `manage_recovery_conf`
Data type: `Any`
Allow Puppet to manage the recovery.conf file.
Default value: `undef`
##### `manage_datadir`
Data type: `Any`
Set to false if you have file{ $datadir: } already defined
Default value: `undef`
##### `manage_logdir`
Data type: `Any`
Set to false if you have file{ $logdir: } already defined
Default value: `undef`
##### `manage_xlogdir`
Data type: `Any`
Set to false if you have file{ $xlogdir: } already defined
Default value: `undef`
##### `manage_package_repo`
Data type: `Any`
Sets up official PostgreSQL repositories on your host if set to true.
Default value: `undef`
##### `module_workdir`
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`
##### `manage_selinux`
Data type: `Any`
Default value: `undef`
### postgresql::lib::devel
This class installs postgresql development libraries.
#### Parameters
The following parameters are available in the `postgresql::lib::devel` class.
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.
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: `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`
##### `package_name`
Data type: `Any`
Specifies the name of the package to use for installing the server software.
Overrides the default behavior to restart your PostgreSQL service when a config entry has been changed that requires a service restart to become active.
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.
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: `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.
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.
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.
Overrides the default PostgreSQL super user and owner of PostgreSQL related files in the file system.
Default value: $postgresql::params::user
##### `group`
Data type: `Any`
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: `Any`
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: `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
##### `locale`
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_checksums`
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.
The following parameters are available in the `postgresql::server::database_grant` defined type.
##### `privilege`
Data type: `Any`
Specifies comma-separated list of privileges to grant. Valid options: 'ALL', 'CREATE', 'CONNECT', 'TEMPORARY', 'TEMP'.
##### `db`
Data type: `Any`
Specifies the database to which you are granting access.
##### `role`
Data type: `Any`
Specifies the role or user whom you are granting access to.
##### `ensure`
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`
##### `psql_db`
Data type: `Any`
Defines the database to execute the grant against. This should not ordinarily be changed from the default
Default value: `undef`
##### `psql_user`
Data type: `Any`
Specifies the OS user for running psql. Default value: The default user for the module, usually 'postgres'.
Default value: `undef`
##### `connect_settings`
Data type: `Any`
Specifies a hash of environment variables used when connecting to a remote server.
Default value: `undef`
### postgresql::server::db
Define for conveniently creating a role, database and assigning the correctpermissions.
#### Parameters
The following parameters are available in the `postgresql::server::db` defined type.
##### `user`
Data type: `Any`
User to create and assign access to the database upon creation. Mandatory.
##### `password`
Data type: `Any`
Required Sets the password for the created user.
##### `comment`
Data type: `Any`
Defines a comment to be stored about the database using the PostgreSQL COMMENT command.
Default value: `undef`
##### `dbname`
Data type: `Any`
Sets the name of the database to be created.
Default value: $title
##### `encoding`
Data type: `Any`
Overrides the character set during creation of the database.
Default value: $postgresql::server::encoding
##### `locale`
Data type: `Any`
Overrides the locale during creation of the database.
Default value: $postgresql::server::locale
##### `grant`
Data type: `Any`
Specifies the permissions to grant during creation. Default value: 'ALL'.
Default value: 'ALL'
##### `tablespace`
Data type: `Any`
Defines the name of the tablespace to allocate the created database to.
Default value: `undef`
##### `template`
Data type: `Any`
Specifies the name of the template database from which to build this database. Defaults value: template0.
Default value: 'template0'
##### `istemplate`
Data type: `Any`
Specifies that the database is a template, if set to true.
Default value: `false`
##### `owner`
Data type: `Any`
Sets a user as the owner of the database.
Default value: `undef`
### 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: `Any`
Specifies the database on which to activate the extension.
##### `extension`
Data type: `Any`
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: `String[1]`
Specifies whether to activate or deactivate the extension. Valid options: 'present' or 'absent'.
Default value: 'present'
##### `package_name`
Data type: `Any`
Specifies a package to install prior to activating the extension.
Default value: `undef`
##### `package_ensure`
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`
+##### `port`
+
+Data type: `Optional[Integer]`
+
+Port to use when connecting.
+
+Default value: `undef`
+
##### `connect_settings`
Data type: `Any`
Specifies a hash of environment variables used when connecting to a remote server.
Specifies the resource name of the DB being managed. Defaults to the parameter $database, if left blank.
Default value: $database
### 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`
##### `psql_db`
Data type: `String`
Specifies the database to execute the grant against. This should not ordinarily be changed from the default
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: `Enum['local', 'host', 'hostssl', 'hostnossl']`
Sets the type of rule.
Enum['local','host','hostssl','hostnossl'].
##### `database`
Data type: `String`
Sets a comma-separated list of databases that this rule matches.
##### `user`
Data type: `String`
Sets a comma-separated list of users that this rule matches.
##### `auth_method`
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.
##### `address`
Data type: `Optional[String]`
Sets a CIDR based address for this rule matching when the type is not 'local'.
Default value: `undef`
##### `description`
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'
##### `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.
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: `Any`
Sets the name of the user map that is used to refer to this mapping in pg_hba.conf.
##### `system_username`
Data type: `Any`
Specifies the operating system user name (the user name used to connect to the database).
##### `database_username`
Data type: `Any`
Specifies the user name of the database user. The system_username is mapped to this user name.
##### `description`
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'
##### `order`
Data type: `Any`
Defines an order for placing the mapping in pg_ident.conf. Default value: 150.
Default value: '150'
##### `target`
Data type: `Any`
Provides the target for the rule and is generally an internal only property. Use with caution.
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: `Any`
The shell command to execute to retrieve an archived segment of the WAL file series.
Default value: `undef`
##### `archive_cleanup_command`
Data type: `Any`
This optional parameter specifies a shell command that will be executed at every restartpoint.
Default value: `undef`
##### `recovery_end_command`
Data type: `Any`
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: `Any`
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: `Any`
This parameter specifies the time stamp up to which recovery will proceed.
Default value: `undef`
##### `recovery_target_xid`
Data type: `Any`
This parameter specifies the transaction ID up to which recovery will proceed.
Default value: `undef`
##### `recovery_target_inclusive`
Data type: `Any`
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: `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`
##### `recovery_target_timeline`
Data type: `Any`
Specifies recovering into a particular timeline.
Default value: `undef`
##### `pause_at_recovery_target`
Data type: `Any`
Specifies whether recovery should pause when the recovery target is reached.
Default value: `undef`
##### `standby_mode`
Data type: `Any`
Specifies whether to start the PostgreSQL server as a standby.
Default value: `undef`
##### `primary_conninfo`
Data type: `Any`
Specifies a connection string to be used for the standby server to connect with the primary.
Default value: `undef`
##### `primary_slot_name`
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`
##### `trigger_file`
Data type: `Any`
Specifies a trigger file whose presence ends recovery in the standby.
Default value: `undef`
##### `recovery_min_apply_delay`
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`
##### `target`
Data type: `Any`
Provides the target for the rule, and is generally an internal only property. Use with caution.
This function escapes a string using [Dollar Quoting](https://www.postgresql.org/docs/12/sql-syntax-lexical.html#SQL-SYNTAX-DOLLAR-QUOTING) using a randomly generated tag if required.