Skip to content
Snippets Groups Projects
Commit c7a0831e authored by Thomas Goirand's avatar Thomas Goirand
Browse files

New upstream version 6.7.0

parent 2cafdf18
Branches
Tags upstream/6.7.0
No related merge requests found
Showing with 4488 additions and 1878 deletions
{
"excludes": [
"**/contrib/**",
"**/examples/**",
"**/tests/**",
"**/spec/**",
"**/pkg/**"
]
}
name: "release"
on:
push:
branches:
- 'release'
jobs:
LitmusAcceptancePuppet5:
env:
HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6
HONEYCOMB_DATASET: litmus tests
runs-on: self-hosted
strategy:
matrix:
ruby_version: [2.5.x]
puppet_gem_version: [~> 6.0]
platform: [release_checks_5]
agent_family: ['puppet5']
steps:
- uses: actions/checkout@v1
- name: Litmus Parallel
uses: puppetlabs/action-litmus_parallel@master
with:
platform: ${{ matrix.platform }}
agent_family: ${{ matrix.agent_family }}
LitmusAcceptancePuppet6:
env:
HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6
HONEYCOMB_DATASET: litmus tests
runs-on: self-hosted
strategy:
matrix:
ruby_version: [2.5.x]
puppet_gem_version: [~> 6.0]
platform: [release_checks_6]
agent_family: ['puppet6']
steps:
- uses: actions/checkout@v1
- name: Litmus Parallel
uses: puppetlabs/action-litmus_parallel@master
with:
platform: ${{ matrix.platform }}
agent_family: ${{ matrix.agent_family }}
Spec:
runs-on: self-hosted
strategy:
matrix:
check: [parallel_spec, 'syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop']
ruby_version: [2.5.x]
puppet_gem_version: [~> 5.0, ~> 6.0]
exclude:
- puppet_gem_version: ~> 5.0
check: 'syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop'
- ruby_version: 2.5.x
puppet_gem_version: ~> 5.0
steps:
- uses: actions/checkout@v1
- name: Spec Tests
uses: puppetlabs/action-litmus_spec@master
with:
puppet_gem_version: ${{ matrix.puppet_gem_version }}
check: ${{ matrix.check }}
name: "weekly"
on:
schedule:
- cron: '0 3 * * 1'
jobs:
LitmusAcceptancePuppet5:
env:
HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6
HONEYCOMB_DATASET: litmus tests
runs-on: self-hosted
strategy:
matrix:
ruby_version: [2.5.x]
puppet_gem_version: [~> 6.0]
platform: [release_checks_5]
agent_family: ['puppet5']
steps:
- uses: actions/checkout@v1
- name: Litmus Parallel
uses: puppetlabs/action-litmus_parallel@master
with:
platform: ${{ matrix.platform }}
agent_family: ${{ matrix.agent_family }}
LitmusAcceptancePuppet6:
env:
HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6
HONEYCOMB_DATASET: litmus tests
runs-on: self-hosted
strategy:
matrix:
ruby_version: [2.5.x]
puppet_gem_version: [~> 6.0]
platform: [release_checks_6]
agent_family: ['puppet6']
steps:
- uses: actions/checkout@v1
- name: Litmus Parallel
uses: puppetlabs/action-litmus_parallel@master
with:
platform: ${{ matrix.platform }}
agent_family: ${{ matrix.agent_family }}
Spec:
runs-on: self-hosted
strategy:
matrix:
check: [parallel_spec, 'syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop']
ruby_version: [2.5.x]
puppet_gem_version: [~> 5.0, ~> 6.0]
exclude:
- puppet_gem_version: ~> 5.0
check: 'syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop'
- ruby_version: 2.5.x
puppet_gem_version: ~> 5.0
steps:
- uses: actions/checkout@v1
- name: Spec Tests
uses: puppetlabs/action-litmus_spec@master
with:
puppet_gem_version: ${{ matrix.puppet_gem_version }}
check: ${{ matrix.check }}
user=puppetlabs
project=puppetlabs-postgresql
since_tag=5.3.0
---
default_set: 'centos-64-x64'
sets:
'centos-59-x64':
nodes:
"main.foo.vm":
prefab: 'centos-59-x64'
'centos-64-x64':
nodes:
"main.foo.vm":
prefab: 'centos-64-x64'
'fedora-18-x64':
nodes:
"main.foo.vm":
prefab: 'fedora-18-x64'
'debian-607-x64':
nodes:
"main.foo.vm":
prefab: 'debian-607-x64'
'debian-70rc1-x64':
nodes:
"main.foo.vm":
prefab: 'debian-70rc1-x64'
'ubuntu-server-10044-x64':
nodes:
"main.foo.vm":
prefab: 'ubuntu-server-10044-x64'
'ubuntu-server-12042-x64':
nodes:
"main.foo.vm":
prefab: 'ubuntu-server-12042-x64'
--relative
---
".gitlab-ci.yml":
delete: true
".travis.yml":
global_env:
- HONEYCOMB_WRITEKEY="7f3c63a70eecc61d635917de46bea4e6",HONEYCOMB_DATASET="litmus tests"
deploy_to_forge:
enabled: false
user: puppet
secure: ''
branches:
- release
use_litmus: true
litmus:
provision_list:
- ---travis_el
- travis_deb
- travis_el6
- travis_el7
- travis_el8
complex:
- collection:
puppet_collection:
- puppet6
provision_list:
- travis_ub_6
- collection:
puppet_collection:
- puppet5
provision_list:
- travis_ub_5
simplecov: true
notifications:
slack:
secure: sulU0RHAFNMVQyQnqcyRHLRjL7Zl1Ao7ywuObL/qTsCiIweRsFiHX0BdTrurxobhjgdHQizx9G2IakkvhE120AOlLbCV9Nw45tvyuzdV4HhdPSKtwdWWKXgU4IvP2tSblZ4hCOEG4CuEKPvFtoY8UEW2ODmvvwFlQz+GOYOBYMw=
appveyor.yml:
delete: true
Gemfile:
optional:
":development":
- gem: github_changelog_generator
git: https://github.com/skywinder/github-changelog-generator
ref: 20ee04ba1234e9e83eb2ffb5056e23d641c7a018
condition: Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')
Rakefile:
extras:
"FastGettext.default_text_domain = 'default-text-domain'"
changelog_user: puppetlabs
spec/spec_helper.rb:
mock_with: ":rspec"
coverage_report: true
# Change log
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).
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).
## Supported Release [5.4.0]
### Summary
This is a minor release, it makes this module PDK-compliant for easier maintenance and includes a roll up of maintenance changes.
## [v6.7.0](https://github.com/puppetlabs/puppetlabs-postgresql/tree/v6.7.0) (2020-08-28)
#### Added
- PDK conversion [MODULES-6330](https://tickets.puppetlabs.com/browse/MODULES-6330).
- Parameter for `postgresql::server::database`:
- `ensure` Capability to revoke database privileges [PostgreSQL documentation for `grant`](http://www.postgresql.org/docs/current/static/sql-grant.html).
- Parameter for `postgresql::server::database_grant`:
- `ensure` Capability to revoke database privileges [PostgreSQL documentation for `grant`](http://www.postgresql.org/docs/current/static/sql-grant.html).
[Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/v6.6.0...v6.7.0)
#### Fixed
- Documentation error, `reassign_owned_by` uses `*_role` not `*_owner`.
### Added
- pdksync - \(IAC-973\) - Update travis/appveyor to run on new default branch `main` [\#1182](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1182) ([david22swan](https://github.com/david22swan))
### Fixed
- Invert psql/package dependency logic [\#1179](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1179) ([raphink](https://github.com/raphink))
## [v6.6.0](https://github.com/puppetlabs/puppetlabs-postgresql/tree/v6.6.0) (2020-06-02)
[Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/v6.5.0...v6.6.0)
### Added
- \(IAC-746\) - Add ubuntu 20.04 support [\#1172](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1172) ([david22swan](https://github.com/david22swan))
### Fixed
- Fix custom port in extension [\#1165](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1165) ([Vampouille](https://github.com/Vampouille))
## [v6.5.0](https://github.com/puppetlabs/puppetlabs-postgresql/tree/v6.5.0) (2020-05-13)
[Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/v6.4.0...v6.5.0)
### Added
- 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))
## [v6.4.0](https://github.com/puppetlabs/puppetlabs-postgresql/tree/v6.4.0) (2020-03-17)
[Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/v6.3.0...v6.4.0)
### Added
- Add Fedora 31 compatibility [\#1141](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1141) ([blackknight36](https://github.com/blackknight36))
- 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))
- Puppet 4 functions [\#1129](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1129) ([binford2k](https://github.com/binford2k))
### Fixed
- 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))
## [v6.3.0](https://github.com/puppetlabs/puppetlabs-postgresql/tree/v6.3.0) (2019-12-18)
[Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/v6.2.0...v6.3.0)
### Added
- 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))
## [v6.2.0](https://github.com/puppetlabs/puppetlabs-postgresql/tree/v6.2.0) (2019-09-12)
[Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/v6.1.0...v6.2.0)
### Added
- FM-8408 - add support on Debian10 [\#1103](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1103) ([lionce](https://github.com/lionce))
- Fix/directory defined twice [\#1089](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1089) ([arcenik](https://github.com/arcenik))
- Adding SLES 15 [\#1087](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1087) ([msurato](https://github.com/msurato))
- \(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))
## [v6.1.0](https://github.com/puppetlabs/puppetlabs-postgresql/tree/v6.1.0) (2019-06-04)
[Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/v6.0.0...v6.1.0)
### Added
- \(FM-8031\) Add RedHat 8 support [\#1083](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1083) ([eimlav](https://github.com/eimlav))
## [v6.0.0](https://github.com/puppetlabs/puppetlabs-postgresql/tree/v6.0.0) (2019-05-14)
[Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/5.12.1...v6.0.0)
### Changed
- pdksync - \(MODULES-8444\) - Raise lower Puppet bound [\#1070](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1070) ([david22swan](https://github.com/david22swan))
- \(maint\) remove inconsistent extra variable [\#1044](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1044) ([binford2k](https://github.com/binford2k))
### Added
- Add Fedora 30 compatibility [\#1067](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1067) ([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))
## [5.12.1](https://github.com/puppetlabs/puppetlabs-postgresql/tree/5.12.1) (2019-02-14)
[Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/5.12.0...5.12.1)
### Fixed
## Supported Release [5.3.0]
- \(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))
## [5.12.0](https://github.com/puppetlabs/puppetlabs-postgresql/tree/5.12.0) (2019-02-01)
[Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/5.11.0...5.12.0)
### Added
- \(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))
- pdksync - \(FM-7655\) Fix rubygems-update for ruby \< 2.3 [\#1042](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1042) ([tphoney](https://github.com/tphoney))
## [5.11.0](https://github.com/puppetlabs/puppetlabs-postgresql/tree/5.11.0) (2018-11-21)
[Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/5.10.0...5.11.0)
### Added
- 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))
## [5.10.0](https://github.com/puppetlabs/puppetlabs-postgresql/tree/5.10.0) (2018-09-27)
[Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/5.9.0...5.10.0)
### Added
- pdksync - \(MODULES-6805\) metadata.json shows support for puppet 6 [\#1026](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1026) ([tphoney](https://github.com/tphoney))
## [5.9.0](https://github.com/puppetlabs/puppetlabs-postgresql/tree/5.9.0) (2018-09-06)
[Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/5.8.0...5.9.0)
### Added
- pdksync - \(MODULES-7705\) - Bumping stdlib dependency from \< 5.0.0 to \< 6.0.0 [\#1018](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1018) ([pmcmaw](https://github.com/pmcmaw))
## [5.8.0](https://github.com/puppetlabs/puppetlabs-postgresql/tree/5.8.0) (2018-08-06)
[Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/5.7.0...5.8.0)
### Added
- 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))
## [5.7.0](https://github.com/puppetlabs/puppetlabs-postgresql/tree/5.7.0) (2018-07-19)
[Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/5.6.0...5.7.0)
### Added
- \(MODULES-7479\) Update postgresql to support Ubuntu 18.04 [\#1005](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1005) ([david22swan](https://github.com/david22swan))
- \(MODULES-6542\) - Adding SLES 11 & 12 to metadata [\#1001](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1001) ([pmcmaw](https://github.com/pmcmaw))
### Fixed
- \(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))
## [5.6.0](https://github.com/puppetlabs/puppetlabs-postgresql/tree/5.6.0) (2018-06-20)
[Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/5.5.0...5.6.0)
### Changed
- 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))
- \(MODULES-5994\) Add debian 9 [\#992](https://github.com/puppetlabs/puppetlabs-postgresql/pull/992) ([hunner](https://github.com/hunner))
- 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))
## [5.5.0](https://github.com/puppetlabs/puppetlabs-postgresql/tree/5.5.0) (2018-04-06)
[Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/5.4.0...5.5.0)
### Added
- 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))
## [5.4.0](https://github.com/puppetlabs/puppetlabs-postgresql/tree/5.4.0) (2018-03-22)
[Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/5.3.0...5.4.0)
### Added
- \(MODULES-6330\) PDK convert 1.4.1 [\#961](https://github.com/puppetlabs/puppetlabs-postgresql/pull/961) ([pmcmaw](https://github.com/pmcmaw))
- 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.
......@@ -993,3 +1213,6 @@ Notable features:
[5.4.0]:https://github.com/puppetlabs/puppetlabs-apache/compare/5.3.0...5.4.0
[5.3.0]:https://github.com/puppetlabs/puppetlabs-apache/compare/5.2.1...5.3.0
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
# Setting ownership to the modules team
* @puppetlabs/modules
source ENV['GEM_SOURCE'] || 'https://rubygems.org'
def location_for(place_or_version, fake_version = nil)
if place_or_version =~ %r{\A(git[:@][^#]*)#(.*)}
[fake_version, { git: Regexp.last_match(1), branch: Regexp.last_match(2), require: false }].compact
elsif place_or_version =~ %r{\Afile:\/\/(.*)}
['>= 0', { path: File.expand_path(Regexp.last_match(1)), require: false }]
else
[place_or_version, { require: false }]
end
end
def gem_type(place_or_version)
if place_or_version =~ %r{\Agit[:@]}
:git
elsif !place_or_version.nil? && place_or_version.start_with?('file:')
:file
else
:gem
end
end
ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
minor_version = ruby_version_segments[0..1].join('.')
group :development do
gem "fast_gettext", '1.1.0', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0')
gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
gem "json_pure", '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9')
gem "puppet-module-posix-default-r#{minor_version}", require: false, platforms: [:ruby]
gem "puppet-module-posix-dev-r#{minor_version}", require: false, platforms: [:ruby]
gem "puppet-module-win-default-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-module-win-dev-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-blacksmith", '~> 3.4', require: false
end
group :system_tests do
gem "puppet-module-posix-system-r#{minor_version}", require: false, platforms: [:ruby]
gem "puppet-module-win-system-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '~> 3.13')
gem "beaker-abs", *location_for(ENV['BEAKER_ABS_VERSION'] || '~> 0.1')
gem "beaker-pe", require: false
gem "beaker-hostgenerator"
gem "beaker-rspec"
end
puppet_version = ENV['PUPPET_GEM_VERSION']
puppet_type = gem_type(puppet_version)
facter_version = ENV['FACTER_GEM_VERSION']
hiera_version = ENV['HIERA_GEM_VERSION']
def puppet_older_than?(version)
puppet_version = ENV['PUPPET_GEM_VERSION']
!puppet_version.nil? &&
Gem::Version.correct?(puppet_version) &&
Gem::Requirement.new("< #{version}").satisfied_by?(Gem::Version.new(puppet_version.dup))
end
gems = {}
gems['puppet'] = location_for(puppet_version)
# If facter or hiera versions have been specified via the environment
# variables, use those versions. If not, and if the puppet version is < 3.5.0,
# use known good versions of both for puppet < 3.5.0.
if facter_version
gems['facter'] = location_for(facter_version)
elsif puppet_type == :gem && puppet_older_than?('3.5.0')
gems['facter'] = ['>= 1.6.11', '<= 1.7.5', require: false]
end
if hiera_version
gems['hiera'] = location_for(ENV['HIERA_GEM_VERSION'])
elsif puppet_type == :gem && puppet_older_than?('3.5.0')
gems['hiera'] = ['>= 1.0.0', '<= 1.3.0', require: false]
end
if Gem.win_platform? && (puppet_type != :gem || puppet_older_than?('3.5.0'))
# For Puppet gems < 3.5.0 (tested as far back as 3.0.0) on Windows
if puppet_type == :gem
gems['ffi'] = ['1.9.0', require: false]
gems['minitar'] = ['0.5.4', require: false]
gems['win32-eventlog'] = ['0.5.3', '<= 0.6.5', require: false]
gems['win32-process'] = ['0.6.5', '<= 0.7.5', require: false]
gems['win32-security'] = ['~> 0.1.2', '<= 0.2.5', require: false]
gems['win32-service'] = ['0.7.2', '<= 0.8.8', require: false]
else
gems['ffi'] = ['~> 1.9.0', require: false]
gems['minitar'] = ['~> 0.5.4', require: false]
gems['win32-eventlog'] = ['~> 0.5', '<= 0.6.5', require: false]
gems['win32-process'] = ['~> 0.6', '<= 0.7.5', require: false]
gems['win32-security'] = ['~> 0.1', '<= 0.2.5', require: false]
gems['win32-service'] = ['~> 0.7', '<= 0.8.8', require: false]
end
gems['win32-dir'] = ['~> 0.3', '<= 0.4.9', require: false]
if RUBY_VERSION.start_with?('1.')
gems['win32console'] = ['1.3.2', require: false]
# sys-admin was removed in Puppet 3.7.0 and doesn't compile under Ruby 2.x
gems['sys-admin'] = ['1.5.6', require: false]
end
# Puppet < 3.7.0 requires these.
# Puppet >= 3.5.0 gem includes these as requirements.
# The following versions are tested to work with 3.0.0 <= puppet < 3.7.0.
gems['win32-api'] = ['1.4.8', require: false]
gems['win32-taskscheduler'] = ['0.2.2', require: false]
gems['windows-api'] = ['0.4.3', require: false]
gems['windows-pr'] = ['1.2.3', require: false]
elsif Gem.win_platform?
# If we're using a Puppet gem on Windows which handles its own win32-xxx gem
# dependencies (>= 3.5.0), set the maximum versions (see PUP-6445).
gems['win32-dir'] = ['<= 0.4.9', require: false]
gems['win32-eventlog'] = ['<= 0.6.5', require: false]
gems['win32-process'] = ['<= 0.7.5', require: false]
gems['win32-security'] = ['<= 0.2.5', require: false]
gems['win32-service'] = ['<= 0.8.8', require: false]
end
gems.each do |gem_name, gem_params|
gem gem_name, *gem_params
end
# Evaluate Gemfile.local and ~/.gemfile if they exist
extra_gemfiles = [
"#{__FILE__}.local",
File.join(Dir.home, '.gemfile'),
]
extra_gemfiles.each do |gemfile|
if File.file?(gemfile) && File.readable?(gemfile)
eval(File.read(gemfile), binding)
end
end
# vim: syntax=ruby
This diff is collapsed.
## Maintenance
Maintainers:
- Puppet Forge Modules Team `forge-modules |at| puppet |dot| com`
Tickets: https://tickets.puppet.com/browse/MODULES. Make sure to set component to `postgresql`.
This diff is collapsed.
This diff is collapsed.
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-syntax/tasks/puppet-syntax'
require 'puppet_blacksmith/rake_tasks'
require 'puppet-lint/tasks/puppet-lint'
{
"CHANGELOG.md": "be24883fec0fc15ca468151152f99c44",
"CONTRIBUTING.md": "4d17f3c942e7c93d1577cc4438a231e4",
"Gemfile": "47f2bb73e730d42a921e7bca4449f5aa",
"LICENSE": "3b83ef96387f14655fc854ddc3c6bd57",
"MAINTAINERS.md": "dede2640dfb244b2d67a280ed6496381",
"NOTICE": "7e066b054e0d528cc400e4b1adfb071d",
"README.md": "dd4996ea5d5a1d5794dafd71e77f718c",
"Rakefile": "892f5f56e24ac668b998bb74fb18035e",
"files/RPM-GPG-KEY-PGDG": "78b5db170d33f80ad5a47863a7476b22",
"files/validate_postgresql_connection.sh": "63814aa224fed8d032bba75fbcdb63e1",
"lib/puppet/parser/functions/postgresql_acls_to_resources_hash.rb": "21ac11d2615d03eb11d754e1c064d9d5",
"lib/puppet/parser/functions/postgresql_escape.rb": "64effdb645e0b8b87af2ce9cbdaef216",
"lib/puppet/parser/functions/postgresql_password.rb": "4efa65e02e7444bdfcf17ece21e2c1be",
"lib/puppet/provider/postgresql_conf/parsed.rb": "05c64ad64e1e668f973a5fda9269c2de",
"lib/puppet/provider/postgresql_conn_validator/ruby.rb": "0d235c3f0d32002a19fbfe4b6da94163",
"lib/puppet/provider/postgresql_psql/ruby.rb": "50a1926a8feab1df87f21c806b80c871",
"lib/puppet/provider/postgresql_replication_slot/ruby.rb": "07eea817fa9d6588720c8aaecabf8a53",
"lib/puppet/type/postgresql_conf.rb": "99163d257e01bd578262e8236c07bc71",
"lib/puppet/type/postgresql_conn_validator.rb": "3d59a36131522b8c1eb5e0610c4d75f2",
"lib/puppet/type/postgresql_psql.rb": "c965ff821132220d131c7c56879f443c",
"lib/puppet/type/postgresql_replication_slot.rb": "5cb0a735bdd358586c1c070f0345015c",
"lib/puppet/util/postgresql_validator.rb": "d8c8a43e0131f2d9d384b14b28f70347",
"locales/config.yaml": "a72e3415a4866d092c1abc1b5dbb4c13",
"locales/ja/puppetlabs-postgresql.po": "285623cbf0526ec90f8b14ff9ead5646",
"locales/puppetlabs-postgresql.pot": "6269eb34430618683eabcbbf5da88b7c",
"manifests/client.pp": "4f1010b71fdd408b09e066448d31ee24",
"manifests/globals.pp": "f5204a88684c780bf8d85ad92797a7f3",
"manifests/lib/devel.pp": "ad16d397e4162cbfc7526308576a289d",
"manifests/lib/docs.pp": "1712d71f6f871790bc5bc809d724fcad",
"manifests/lib/java.pp": "01a31e39438dcad96202efc62ad4eb51",
"manifests/lib/perl.pp": "31321952e971b001e60f604ebd3fa6db",
"manifests/lib/python.pp": "43f77ea57e29a95baf3d891f36df87f1",
"manifests/params.pp": "5cbcab2e4c38a5146318f0bc2cb0c6f4",
"manifests/repo/apt_postgresql_org.pp": "e21e5d7cf57b64e85a9d4426a6806562",
"manifests/repo/yum_postgresql_org.pp": "82cd0adf5a3ca614c1258042dcc04508",
"manifests/repo.pp": "c7569fd4a3fb277b3706bbddd24ef2ed",
"manifests/server/config.pp": "808de66556c1bdfcb1fcce8a426df5b7",
"manifests/server/config_entry.pp": "7a9f07ff903892217054524c0d77fc45",
"manifests/server/contrib.pp": "e8a9586c5bc9c9b781902d3bc262799b",
"manifests/server/database.pp": "4de4db83e23f88a5cd2e0b68ec5ecebe",
"manifests/server/database_grant.pp": "a6f68d9312fad86216bc1c5aff0e4a57",
"manifests/server/db.pp": "9fcadbe5737068bdefa818b09c7ab08f",
"manifests/server/extension.pp": "58356fdb56bfbf7f32b0dac944b1b52c",
"manifests/server/grant.pp": "1b5eae0c51be18aa64b5dfb2af2a2390",
"manifests/server/grant_role.pp": "88ce9e29ffb806491e041ddbee0d9bb5",
"manifests/server/initdb.pp": "3f25fa90a6a3c89bb94eb05746776dc0",
"manifests/server/install.pp": "e0ff19f2a4dc8a4814e0ee62786d1387",
"manifests/server/passwd.pp": "5ec205c563ef675db86e8f6a7c5ff46c",
"manifests/server/pg_hba_rule.pp": "cb93580e0a6fb32c7c200caa55d6fa32",
"manifests/server/pg_ident_rule.pp": "0fa70e2d42d17c59f41bd3351d5d96fb",
"manifests/server/plperl.pp": "9253cd4d76c18566fa2bf9619bb76017",
"manifests/server/plpython.pp": "712d1e2539018a04614f6522e9f5d9a5",
"manifests/server/postgis.pp": "50cbd9a653408d23c0e276c30639befa",
"manifests/server/reassign_owned_by.pp": "70f795a9a53da55202553a40bf0661ca",
"manifests/server/recovery.pp": "e3b559cae82bd2c890f40cb7949bbe81",
"manifests/server/reload.pp": "218ac61018f7fab71f250284c4b879d0",
"manifests/server/role.pp": "03e26dddbfea2b5b164bbde199167b7d",
"manifests/server/schema.pp": "e48c80a34f2be53283e05e456b73b77e",
"manifests/server/service.pp": "e42e1338a514498f436f7a6b13a71d6e",
"manifests/server/table_grant.pp": "ce5309b325ae48c822b92a6363f8caad",
"manifests/server/tablespace.pp": "79e486a94083335aa139c52120897c1f",
"manifests/server.pp": "49264f4fae30bfef5d2f95f89347bb4d",
"manifests/validate_db_connection.pp": "b5a853e96310125c2d895bacc33f2c38",
"metadata.json": "f0229e7b4ad17aa405d7731f7fbf8ed2",
"readmes/README_ja_JP.md": "b27e36ee602fb04b8524afdb7df6279b",
"spec/acceptance/00-utf8_encoding_spec.rb": "b5a96112c976f3a28e9d5e1272592343",
"spec/acceptance/alternative_port_spec.rb": "c08c8fc364efc54f8e2da9bbf8a151c2",
"spec/acceptance/db_spec.rb": "2822d25dfa8c00e3d377586998150504",
"spec/acceptance/default_parameters_spec.rb": "ce417ff2efc6dff1ba0b1b6ce3970bf6",
"spec/acceptance/nodesets/centos-7-x64.yml": "a713f3abd3657f0ae2878829badd23cd",
"spec/acceptance/nodesets/debian-8-x64.yml": "d2d2977900989f30086ad251a14a1f39",
"spec/acceptance/nodesets/default.yml": "b42da5a1ea0c964567ba7495574b8808",
"spec/acceptance/nodesets/docker/centos-7.yml": "8a3892807bdd62306ae4774f41ba11ae",
"spec/acceptance/nodesets/docker/debian-8.yml": "ac8e871d1068c96de5e85a89daaec6df",
"spec/acceptance/nodesets/docker/ubuntu-14.04.yml": "dc42ee922a96908d85b8f0f08203ce58",
"spec/acceptance/postgresql_conn_validator_spec.rb": "352f290e81cd66b1886b33986dca60fa",
"spec/acceptance/postgresql_psql_spec.rb": "285c7af990bca7c00b621e058e40fabc",
"spec/acceptance/remote_access_spec.rb": "29d48487faec394597bd03f4c2efba57",
"spec/acceptance/server/config_entry_spec.rb": "74af47261383e102e3ad44d810529a3c",
"spec/acceptance/server/grant_role_spec.rb": "27ace0895e9c12c479d8de7d1f8abf3d",
"spec/acceptance/server/grant_spec.rb": "2b5a691dec2ba82a861d427c68acfea8",
"spec/acceptance/server/reassign_owned_by_spec.rb": "0c8af957263d136b08024c6646c8c4c9",
"spec/acceptance/server/recovery_spec.rb": "67e6469d6ba9c38be10a8d1cfdc1686b",
"spec/acceptance/server/schema_spec.rb": "00a17c63d37bd819de202c56d6657e9a",
"spec/acceptance/sql_task_spec.rb": "599d6cb97fe1b3d4ce5c2b1915464dd0",
"spec/acceptance/z_alternative_pgdata_spec.rb": "e92930e4028ffc01e7963e81dc579bc6",
"spec/spec_helper.rb": "6a8493cc89df06740a1f7ed364aed66c",
"spec/spec_helper_acceptance.rb": "58e43d012f4ca233849384b65951f3b4",
"spec/spec_helper_local.rb": "3a50ad073f49d04a019212652a67c6ba",
"spec/unit/classes/client_spec.rb": "813fc3fc09bd3d120f3d0fb2ba079d8b",
"spec/unit/classes/globals_spec.rb": "dbb95c3e3c8a013f5076e4794cd6d052",
"spec/unit/classes/lib/devel_spec.rb": "246884c6eb52acd6c4881abd8cc39471",
"spec/unit/classes/lib/java_spec.rb": "119dc3a4310486fe4f7a4d467733c1b4",
"spec/unit/classes/lib/perl_spec.rb": "93611307f26c575f253fb1e29c19ab62",
"spec/unit/classes/lib/pgdocs_spec.rb": "2d5cc5e0ebe7643ce154d2fe9a38583b",
"spec/unit/classes/lib/python_spec.rb": "d5c978b12cc903025381ce44b44f7945",
"spec/unit/classes/params_spec.rb": "cb968a44911a1609e30ab72449c43f19",
"spec/unit/classes/repo_spec.rb": "4db78714dae8a961c32bb658553ce281",
"spec/unit/classes/server/config_spec.rb": "43c91715fc8434f91b084a8e3e740b66",
"spec/unit/classes/server/contrib_spec.rb": "84fdda979ae0688635f3f930b89ce4fb",
"spec/unit/classes/server/initdb_spec.rb": "52a42394e68622662a8e07117cdc7fec",
"spec/unit/classes/server/plperl_spec.rb": "5e618601fcf426e1fd948af7c2a463a8",
"spec/unit/classes/server/plpython_spec.rb": "ef24ab6e7e91a7982e9df1f95e4a5ed0",
"spec/unit/classes/server/postgis_spec.rb": "b5ae2e2f5da3a8839d6c5d5f7f40cef3",
"spec/unit/classes/server_spec.rb": "69c1d6766f3ef9b7e9c39ef6ea394af8",
"spec/unit/defines/server/config_entry_spec.rb": "5e2bed32daf62c2e2de2f57faa555567",
"spec/unit/defines/server/database_grant_spec.rb": "202a8c65a493b2238591771637efb370",
"spec/unit/defines/server/database_spec.rb": "1496b98dc576d6ce07ae4dda23c19d55",
"spec/unit/defines/server/db_spec.rb": "f1f17fa8dc0d102bfa26c4ed42aac39c",
"spec/unit/defines/server/extension_spec.rb": "e8f6864060a3405feb968c47300ed970",
"spec/unit/defines/server/grant_role_spec.rb": "c307905e5efa3ebba0fe9ad3c9acacb7",
"spec/unit/defines/server/grant_spec.rb": "2c84a7596557b07f0d8c282ff7620061",
"spec/unit/defines/server/pg_hba_rule_spec.rb": "df5d8249fd465becff5a5dbdbdeae751",
"spec/unit/defines/server/pg_ident_rule_spec.rb": "a21e49734bf184948d678ae2d53e9f34",
"spec/unit/defines/server/reassign_owned_by_spec.rb": "c59d1c61748d97c46aef4147af797124",
"spec/unit/defines/server/recovery_spec.rb": "7a38907d3e0fea9a207094053b3670e3",
"spec/unit/defines/server/role_spec.rb": "41b1f64d34c5b2ea0e8bf0c14c02514b",
"spec/unit/defines/server/schema_spec.rb": "61bb95ed79816d2264f4b4a782f7f131",
"spec/unit/defines/server/table_grant_spec.rb": "a88a3ab4c3f4b68cf5fbc240b52c1550",
"spec/unit/defines/server/tablespace_spec.rb": "9066a6dbeb7021cc98b9bce065308dc5",
"spec/unit/defines/validate_db_connection_spec.rb": "cdd31873fd14ae1ff3bc4ab5e5392704",
"spec/unit/functions/postgresql_acls_to_resources_hash_spec.rb": "78706744e306bf2559380dc01b1c21bf",
"spec/unit/functions/postgresql_escape_spec.rb": "0c157de994358ba98ca80a9360b47164",
"spec/unit/functions/postgresql_password_spec.rb": "1eb57555f9cfdf211b575d355707d4e0",
"spec/unit/provider/postgresql_conf/parsed_spec.rb": "220d8515dfa07da87fe510337a863cf1",
"spec/unit/puppet/provider/postgresql_conn_validator/ruby_spec.rb": "7b62a025b945a5d4a37c52da46eea72a",
"spec/unit/puppet/provider/postgresql_psql/ruby_spec.rb": "d4f7286d7bee20102207595523c0670e",
"spec/unit/puppet/provider/postgresql_replication_slot/ruby_spec.rb": "369abe17840f1ea7e6a0be657418e8d4",
"spec/unit/puppet/type/postgresql_conn_validator.rb": "5c34a751f6dcb03976037c0a6f422a18",
"spec/unit/puppet/type/postgresql_psql_spec.rb": "6436de5888105720ca86014d84cda3b7",
"spec/unit/puppet/type/postgresql_replication_slot_spec.rb": "d25cf4e8ce6e0cc97a62ee4378feba46",
"spec/unit/type/postgresql_conf_spec.rb": "c114b2c61d1ffc4e393d3113f7e99616",
"tasks/sql.json": "fbc23911834bbc21c377cd2699a4d561",
"tasks/sql.rb": "70261104ddcaf9c57980110adc9d17bd",
"templates/pg_hba_rule.conf": "13b46eecdfd359eddff71fa485ef2f54",
"templates/pg_ident_rule.conf": "444c85172fd44262344588e83ebb2515",
"templates/recovery.conf.erb": "ea5dc47b65f7b9596244f7e9e48085ba",
"templates/systemd-override.erb": "8efd876775a4bb401803366ba90dd718"
}
\ No newline at end of file
# @summary This function pull default values from the `params` class or `globals` class if the value is not present in `params`.
#
# @example
# postgresql::default('variable')
#
function postgresql::default(
String $parameter_name
){
include postgresql::params
#search for the variable name in params first
#then fall back to globals if not found
pick( getvar("postgresql::params::${parameter_name}"),
"postgresql::globals::${parameter_name}")
}
# postgresql_acls_to_resources_hash.rb
module Puppet::Parser::Functions
newfunction(:postgresql_acls_to_resources_hash, type: :rvalue, doc: <<-EOS
This internal function translates the ipv(4|6)acls format into a resource
suitable for create_resources. It is not intended to be used outside of the
postgresql internal classes/defined resources.
This function accepts an array of strings that are pg_hba.conf rules. It
will return a hash that can be fed into create_resources to create multiple
individual pg_hba_rule resources.
The second parameter is an identifier that will be included in the namevar
to provide uniqueness. It must be a string.
The third parameter is an order offset, so you can start the order at an
arbitrary starting point.
EOS
) do |args|
func_name = 'postgresql_acls_to_resources_hash()'
if args.size != 3
raise(Puppet::ParseError, "#{func_name}: Wrong number of arguments " \
"given (#{args.size} for 3)")
end
acls = args[0]
raise(Puppet::ParseError, "#{func_name}: first argument must be an array") \
unless acls.instance_of? Array
id = args[1]
raise(Puppet::ParseError, "#{func_name}: second argument must be a string") \
unless id.instance_of? String
offset = args[2].to_i
raise(Puppet::ParseError, "#{func_name}: third argument must be a number") \
unless offset.is_a? Integer
# @summary This internal function translates the ipv(4|6)acls format into a resource suitable for create_resources.
# @api private
Puppet::Functions.create_function(:'postgresql::postgresql_acls_to_resources_hash') do
# @param acls
# An array of strings that are pg_hba.conf rules.
# @param id
# An identifier that will be included in the namevar to provide uniqueness.
# @param offset
# An order offset, so you can start the order at an arbitrary starting point.
#
# @return [Hash]
# A hash that can be fed into create_resources to create multiple individual pg_hba_rule resources.
dispatch :default_impl do
param 'Array[String]', :acls
param 'String[1]', :id
param 'Integer[0]', :offset
end
def default_impl(acls, id, offset)
resources = {}
acls.each do |acl|
index = acls.index(acl)
......@@ -42,15 +24,15 @@ module Puppet::Parser::Functions
parts = acl.split
unless parts.length >= 4
raise(Puppet::ParseError, "#{func_name}: acl line #{index} does not " \
raise(Puppet::ParseError, "postgresql::postgresql_acls_to_resources_hash(): acl line #{index} does not " \
'have enough parts')
end
resource = {
'type' => parts[0],
'type' => parts[0],
'database' => parts[1],
'user' => parts[2],
'order' => format('%03d', offset + index), # rubocop:disable Style/FormatString
'user' => parts[2],
'order' => '%03d' % (offset + index),
}
if parts[0] == 'local'
resource['auth_method'] = parts[3]
......
require 'digest/md5'
# @summary 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.
Puppet::Functions.create_function(:'postgresql::postgresql_escape') do
# @param input_string
# The unescaped string you want to escape using `dollar quoting`
#
# @return [String]
# A `Dollar Quoted` string
dispatch :default_impl do
param 'String[1]', :input_string
end
def default_impl(input_string)
# Where allowed, just return the original string wrapped in `$$`
return "$$#{input_string}$$" unless tag_needed?(input_string)
# Keep generating possible values for tag until we find one that doesn't appear in the input string
tag = Digest::MD5.hexdigest(input_string)[0..5].gsub(%r{\d}, '')
until input_string !~ %r{#{tag}}
tag = Digest::MD5.hexdigest(tag)[0..5].gsub(%r{\d}, '')
end
"$#{tag}$#{input_string}$#{tag}$"
end
def tag_needed?(input_string)
input_string =~ %r{\$\$} || input_string.end_with?('$')
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment