From cd4c5c9194a811078df01e8c8a2f691a38be2eaf Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Thu, 19 Oct 2023 11:28:23 +0200 Subject: [PATCH 01/69] dnfmodule: update documentation about affected OSes --- REFERENCE.md | 3 +-- manifests/dnfmodule.pp | 2 +- manifests/globals.pp | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/REFERENCE.md b/REFERENCE.md index 207f4ab99a..7d7b672790 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -654,8 +654,7 @@ Default value: `undef` Data type: `Boolean` Manage the DNF module. This only makes sense on distributions that use DNF -package manager, such as EL8 or Fedora. It also requires Puppet 5.5.20+ or -Puppet 6.15.0+ since they ship the dnfmodule provider. +package manager, such as EL8, EL9 or Fedora. Default value: `false` diff --git a/manifests/dnfmodule.pp b/manifests/dnfmodule.pp index a320ba0d42..ef9316c4d5 100644 --- a/manifests/dnfmodule.pp +++ b/manifests/dnfmodule.pp @@ -1,6 +1,6 @@ # @summary Manage the DNF module # -# On EL8 and Fedora DNF can manage modules. This is a method of providing +# On EL8 and newer and Fedora DNF can manage modules. This is a method of providing # multiple versions on the same OS. Only one DNF module can be active at the # same time. # diff --git a/manifests/globals.pp b/manifests/globals.pp index ddd9353a73..381da29b26 100644 --- a/manifests/globals.pp +++ b/manifests/globals.pp @@ -96,8 +96,7 @@ # @param manage_package_repo Sets up official PostgreSQL repositories on your host if set to true. # @param manage_dnf_module # Manage the DNF module. This only makes sense on distributions that use DNF -# package manager, such as EL8 or Fedora. It also requires Puppet 5.5.20+ or -# Puppet 6.15.0+ since they ship the dnfmodule provider. +# package manager, such as EL8, EL9 or Fedora. # @param module_workdir # Specifies working directory under which the psql command should be executed. # May need to specify if '/tmp' is on volume mounted with noexec option. From dfca7cddb229a45817b0eab00b6ba7870ccec2b0 Mon Sep 17 00:00:00 2001 From: Simon Hoenscheid Date: Wed, 25 Oct 2023 13:56:24 +0200 Subject: [PATCH 02/69] postgresql_conf: add spec tests for value param --- spec/unit/type/postgresql_conf_spec.rb | 63 ++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/spec/unit/type/postgresql_conf_spec.rb b/spec/unit/type/postgresql_conf_spec.rb index 9ce4269bfa..a2d54006be 100644 --- a/spec/unit/type/postgresql_conf_spec.rb +++ b/spec/unit/type/postgresql_conf_spec.rb @@ -51,5 +51,68 @@ expect { described_class.new(name: 'foo', ensure: :foo) }.to raise_error(Puppet::Error, %r{Invalid value}) end end + # boolean https://www.postgresql.org/docs/current/datatype-boolean.html + describe 'validate boolean values with newvalues function' do + it 'validates log_checkpoints with value on' do + expect { described_class.new(name: 'log_checkpoints', value: 'on') }.not_to raise_error + end + it 'validates log_checkpoints with value off' do + expect { described_class.new(name: 'log_checkpoints', value: 'off') }.not_to raise_error + end + it 'validates log_checkpoints with value true' do + expect { described_class.new(name: 'log_checkpoints', value: 'true') }.not_to raise_error + end + it 'validates log_checkpoints with value false' do + expect { described_class.new(name: 'log_checkpoints', value: 'false') }.not_to raise_error + end + it 'validates log_checkpoints with value yes' do + expect { described_class.new(name: 'log_checkpoints', value: 'yes') }.not_to raise_error + end + it 'validates log_checkpoints with value no' do + expect { described_class.new(name: 'log_checkpoints', value: 'no') }.not_to raise_error + end + it 'validates log_checkpoints with value 1' do + expect { described_class.new(name: 'log_checkpoints', value: '1') }.not_to raise_error + end + it 'validates log_checkpoints with value 0' do + expect { described_class.new(name: 'log_checkpoints', value: '0') }.not_to raise_error + end + end + # enums https://www.postgresql.org/docs/current/datatype-enum.html + describe 'validate enum values with newvalues function' do + it 'validates ssl_min_protocol_version with value TLSv1.3' do + expect { described_class.new(name: 'ssl_min_protocol_version', value: 'TLSv1.3') }.not_to raise_error + end + it 'validates ssl_min_protocol_version with value TLSv1.1' do + expect { described_class.new(name: 'ssl_min_protocol_version', value: 'TLSv1.1') }.not_to raise_error + end + end + # integer https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-INT + describe 'validate integer values with newvalues function' do + it 'validates max_connections with value 1000' do + expect { described_class.new(name: 'max_connections', value: '1000') }.not_to raise_error + end + end + # real https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-FLOAT + describe 'validate real values with newvalues function' do + it 'validates parallel_tuple_cost with value 0.3' do + expect { described_class.new(name: 'parallel_tuple_cost', value: '0.3') }.not_to raise_error + end + end + # string https://www.postgresql.org/docs/current/datatype-character.html + describe 'validate complex string values with newvalues function' do + it 'validates log_filename with value psql_01-%Y-%m-%d.log' do + expect { described_class.new(name: 'log_filename', value: 'psql_01-%Y-%m-%d.log') }.not_to raise_error + end + end + # string https://www.postgresql.org/docs/current/datatype-character.html + describe 'validate string values with newvalues function' do + it 'validates log_timezone with value UTC' do + expect { described_class.new(name: 'log_timezone', value: 'UTC') }.not_to raise_error + end + it 'validates ssl_ciphers with value HIGH:MEDIUM:+3DES:!aNULL' do + expect { described_class.new(name: 'ssl_ciphers', value: 'HIGH:MEDIUM:+3DES:!aNULL') }.not_to raise_error + end + end end end From 9facc5d3277043b2b923fc86b0a1567d55f5b58a Mon Sep 17 00:00:00 2001 From: Simon Hoenscheid Date: Wed, 25 Oct 2023 11:50:50 +0200 Subject: [PATCH 03/69] update values regex --- lib/puppet/type/postgresql_conf.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/puppet/type/postgresql_conf.rb b/lib/puppet/type/postgresql_conf.rb index 432f5aa877..5cd753e20f 100644 --- a/lib/puppet/type/postgresql_conf.rb +++ b/lib/puppet/type/postgresql_conf.rb @@ -16,7 +16,7 @@ newproperty(:value) do desc 'The value to set for this parameter.' - newvalues(%r{^\S(.*\S)?$}) + newvalues(%r{^(\S.*)?$}) munge do |value| if value.to_i.to_s == value From e3dabd1ded2179b3e533243cce36d0e2c9b3c912 Mon Sep 17 00:00:00 2001 From: Simon Hoenscheid Date: Wed, 25 Oct 2023 13:56:24 +0200 Subject: [PATCH 04/69] add spec tests for regex validation --- spec/unit/type/postgresql_conf_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/unit/type/postgresql_conf_spec.rb b/spec/unit/type/postgresql_conf_spec.rb index a2d54006be..f6e972f620 100644 --- a/spec/unit/type/postgresql_conf_spec.rb +++ b/spec/unit/type/postgresql_conf_spec.rb @@ -101,6 +101,12 @@ end # string https://www.postgresql.org/docs/current/datatype-character.html describe 'validate complex string values with newvalues function' do + it 'validates log_line_prefix with value [%p] %q:%u:%d:%' do + expect { described_class.new(name: 'log_line_prefix', value: '[%p] %q:%u:%d:%x ') }.not_to raise_error + end + it 'validates log_line_prefix with value %t %q%u@%d %p %i' do + expect { described_class.new(name: 'log_line_prefix', value: '%t %q%u@%d %p %i ') }.not_to raise_error + end it 'validates log_filename with value psql_01-%Y-%m-%d.log' do expect { described_class.new(name: 'log_filename', value: 'psql_01-%Y-%m-%d.log') }.not_to raise_error end From 86b6bc633e373d603c92aea0c12c67bf9a463bd7 Mon Sep 17 00:00:00 2001 From: rajat-puppet Date: Mon, 6 Nov 2023 18:07:12 +0530 Subject: [PATCH 05/69] Adding github directory to pdkignore --- .pdkignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.pdkignore b/.pdkignore index 584438f9a0..862847a72c 100644 --- a/.pdkignore +++ b/.pdkignore @@ -29,6 +29,7 @@ /.fixtures.yml /Gemfile /.gitattributes +/.github/ /.gitignore /.pdkignore /.puppet-lint.rc From 50367d83e4e04440a5e305e2021aa1ad57af529d Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Wed, 8 Nov 2023 16:14:23 +0000 Subject: [PATCH 06/69] Release prep v10.0.2 --- CHANGELOG.md | 8 ++++++++ REFERENCE.md | 2 +- metadata.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c4ba757846..09a8743765 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ 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). +## [v10.0.2](https://github.com/puppetlabs/puppetlabs-postgresql/tree/v10.0.2) - 2023-11-08 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/v10.0.1...v10.0.2) + +### Fixed + +- postgresql_conf: Fix regex for value param and add tests [#1544](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1544) ([SimonHoenscheid](https://github.com/SimonHoenscheid)) + ## [v10.0.1](https://github.com/puppetlabs/puppetlabs-postgresql/tree/v10.0.1) - 2023-10-12 [Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/v10.0.0...v10.0.1) diff --git a/REFERENCE.md b/REFERENCE.md index 7d7b672790..45c57daaa2 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -4325,7 +4325,7 @@ Default value: `present` ##### `value` -Valid values: `%r{^\S(.*\S)?$}` +Valid values: `%r{^(\S.*)?$}` The value to set for this parameter. diff --git a/metadata.json b/metadata.json index 62ae9b9280..11c710b417 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-postgresql", - "version": "10.0.1", + "version": "10.0.2", "author": "puppetlabs", "summary": "Offers support for basic management of PostgreSQL databases.", "license": "Apache-2.0", From cad6e4bedaabeafacec7ba839d096105c8509d33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Sat, 11 Nov 2023 11:53:41 -1000 Subject: [PATCH 07/69] Unconfine postgresql_conf Ruby should be available on all platforms (bundled with AIO, and in any case required to run Puppet), so the provider should be functional everywhere. Fixes #1550 --- lib/puppet/provider/postgresql_conf/ruby.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/puppet/provider/postgresql_conf/ruby.rb b/lib/puppet/provider/postgresql_conf/ruby.rb index 63b87478d1..ab89864d10 100644 --- a/lib/puppet/provider/postgresql_conf/ruby.rb +++ b/lib/puppet/provider/postgresql_conf/ruby.rb @@ -9,7 +9,6 @@ Puppet::Type.type(:postgresql_conf).provide(:ruby) do desc 'Set keys, values and comments in a postgresql config file.' - confine kernel: 'Linux' # The function pareses the postgresql.conf and figures out which active settings exist in a config file and returns an array of hashes # From bd804b5836bfc2c0f9614539d68fad7bf9afcf82 Mon Sep 17 00:00:00 2001 From: Ramesh Sencha Date: Mon, 20 Nov 2023 11:32:13 +0530 Subject: [PATCH 08/69] "CAT-945 - Update README.md LICENSE" --- README.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2785010a37..81930172ed 100644 --- a/README.md +++ b/README.md @@ -19,10 +19,11 @@ * [Backups](#backups) 4. [Reference - An under-the-hood peek at what the module is doing and how](#reference) 5. [Limitations - OS compatibility, etc.](#limitations) -6. [Development - Guide for contributing to the module](#development) +6. [License](#license) +7. [Development - Guide for contributing to the module](#development) * [Contributors - List of module contributors](#contributors) -7. [Tests](#tests) -8. [Contributors - List of module contributors](#contributors) +8. [Tests](#tests) +9. [Contributors - List of module contributors](#contributors) ## Module description @@ -559,6 +560,10 @@ If you have SELinux enabled and you are *not* using the selinux module to manage semanage port -a -t postgresql_port_t -p tcp $customport ``` +## License + +This codebase is licensed under the Apache2.0 licensing, however due to the nature of the codebase the open source dependencies may also use a combination of [AGPL](https://www.gnu.org/licenses/agpl-3.0.en.html), [BSD-2](https://opensource.org/license/bsd-2-claus), [BSD-3](https://opensource.org/license/bsd-3-claus), [GPL2.0](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html), [LGPL](https://opensource.org/license/lgpl-3-0/), [MIT](https://opensource.org/license/mit/) and [MPL](https://opensource.org/license/mpl-2-0/) Licensing. + ## Development Puppet Labs modules on the Puppet Forge are open projects, and community contributions are essential for keeping them great. We can’t access the huge number of platforms and myriad hardware, software, and deployment configurations that Puppet is intended to serve. We want to keep it as easy as possible to contribute changes so that our modules work in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things. For more information, see our [module contribution guide](https://puppet.com/docs/puppet/latest/contributing.html). From f54ab9c4a32934b066eeacbb23ba1ae0e6fe2291 Mon Sep 17 00:00:00 2001 From: Ramesh Sencha Date: Thu, 23 Nov 2023 10:51:33 +0530 Subject: [PATCH 09/69] Addressing review comments --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 81930172ed..c7189eb025 100644 --- a/README.md +++ b/README.md @@ -562,7 +562,7 @@ semanage port -a -t postgresql_port_t -p tcp $customport ## License -This codebase is licensed under the Apache2.0 licensing, however due to the nature of the codebase the open source dependencies may also use a combination of [AGPL](https://www.gnu.org/licenses/agpl-3.0.en.html), [BSD-2](https://opensource.org/license/bsd-2-claus), [BSD-3](https://opensource.org/license/bsd-3-claus), [GPL2.0](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html), [LGPL](https://opensource.org/license/lgpl-3-0/), [MIT](https://opensource.org/license/mit/) and [MPL](https://opensource.org/license/mpl-2-0/) Licensing. +This codebase is licensed under the Apache2.0 licensing, however due to the nature of the codebase the open source dependencies may also use a combination of [AGPL](https://opensource.org/license/agpl-v3/), [BSD-2](https://opensource.org/license/bsd-2-clause/), [BSD-3](https://opensource.org/license/bsd-3-clause/), [GPL2.0](https://opensource.org/license/gpl-2-0/), [LGPL](https://opensource.org/license/lgpl-3-0/), [MIT](https://opensource.org/license/mit/) and [MPL](https://opensource.org/license/mpl-2-0/) Licensing. ## Development From 9d4fc30bf4a8d0eb9d1b2d3f4401fd8170eb26bd Mon Sep 17 00:00:00 2001 From: Andreas Ntaflos Date: Thu, 23 Nov 2023 18:08:47 +0100 Subject: [PATCH 10/69] (#1556) Fix Python package name for Ubuntu >= 22.04 and Debian 12 For Ubuntu 22.04 and Debian 12 and later the Python PostgreSQL package is called "python3-psycopg2" so make that distinction in params.pp. --- manifests/params.pp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/manifests/params.pp b/manifests/params.pp index 50f916a7b4..c777b0793c 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -159,7 +159,15 @@ $perl_package_name = pick($perl_package_name, 'libdbd-pg-perl') $plperl_package_name = pick($plperl_package_name, "postgresql-plperl-${version}") $plpython_package_name = pick($plpython_package_name, "postgresql-plpython-${version}") - $python_package_name = pick($python_package_name, 'python-psycopg2') + + $_ubuntu_2204 = ($facts['os']['name'] == 'Ubuntu' and versioncmp($facts['os']['release']['full'], '22.04') >= 0) + $_debian_12 = ($facts['os']['name'] == 'Debian' and versioncmp($facts['os']['release']['full'], '12') >= 0) + + if $_ubuntu_2204 or $_debian_12 { + $python_package_name = pick($python_package_name, 'python3-psycopg2') + } else { + $python_package_name = pick($python_package_name, 'python-psycopg2') + } $bindir = pick($bindir, "/usr/lib/postgresql/${version}/bin") $datadir = pick($datadir, "/var/lib/postgresql/${version}/main") From ae4a22b88a0909462b4a44cf6dc984a1eb27b337 Mon Sep 17 00:00:00 2001 From: Ramesh Sencha Date: Wed, 29 Nov 2023 11:00:07 +0530 Subject: [PATCH 11/69] (CAT-1608) - PDK update --- .rubocop.yml | 6 +++--- .rubocop_todo.yml | 2 +- .sync.yml | 10 +++++----- Gemfile | 6 ++++-- Rakefile | 3 ++- metadata.json | 2 +- 6 files changed, 16 insertions(+), 13 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 33d66a7ca1..7a66e08331 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,12 +1,11 @@ --- -inherit_from: .rubocop_todo.yml - require: - rubocop-performance - rubocop-rspec AllCops: + NewCops: enable DisplayCopNames: true - TargetRubyVersion: '2.6' + TargetRubyVersion: '2.7' Include: - "**/*.rb" Exclude: @@ -20,6 +19,7 @@ AllCops: - "**/Puppetfile" - "**/Vagrantfile" - "**/Guardfile" +inherit_from: ".rubocop_todo.yml" Layout/LineLength: Description: People have wide screens, use them. Max: 200 diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 40bf4779ee..732977e113 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2023-09-06 12:10:39 UTC using RuboCop version 1.48.1. +# on 2023-11-29 05:29:46 UTC using RuboCop version 1.48.1. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new diff --git a/.sync.yml b/.sync.yml index 467ee6175a..2721daf03f 100644 --- a/.sync.yml +++ b/.sync.yml @@ -6,7 +6,8 @@ - 140chars-check appveyor.yml: delete: true - +.rubocop.yml: + include_todos: true Gemfile: optional: ":development": @@ -15,6 +16,9 @@ Gemfile: Rakefile: changelog_user: puppetlabs changelog_max_issues: 500 + extra_disabled_lint_checks: + - anchor_resource + - params_empty_string_assignment spec/spec_helper.rb: mock_with: ":rspec" coverage_report: true @@ -45,7 +49,3 @@ spec/spec_helper.rb: unmanaged: false .travis.yml: delete: true -Rakefile: - extra_disabled_lint_checks: - - anchor_resource - - params_empty_string_assignment diff --git a/Gemfile b/Gemfile index 5ffa566b9f..86e337adbc 100644 --- a/Gemfile +++ b/Gemfile @@ -23,7 +23,6 @@ group :development do gem "voxpupuli-puppet-lint-plugins", '~> 5.0', require: false gem "facterdb", '~> 1.18', require: false gem "metadata-json-lint", '~> 3.0', require: false - gem "puppetlabs_spec_helper", '~> 6.0', require: false gem "rspec-puppet-facts", '~> 2.0', require: false gem "codecov", '~> 0.2', require: false gem "dependency_checker", '~> 1.0.0', require: false @@ -34,7 +33,6 @@ group :development do gem "rubocop", '= 1.48.1', require: false gem "rubocop-performance", '= 1.16.0', require: false gem "rubocop-rspec", '= 2.19.0', require: false - gem "puppet-strings", '~> 4.0', require: false gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw] gem "github_changelog_generator", '= 1.15.2', require: false end @@ -42,6 +40,10 @@ group :system_tests do gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw] gem "serverspec", '~> 2.41', require: false end +group :release_prep do + gem "puppet-strings", '~> 4.0', require: false + gem "puppetlabs_spec_helper", '~> 7.0', require: false +end puppet_version = ENV['PUPPET_GEM_VERSION'] facter_version = ENV['FACTER_GEM_VERSION'] diff --git a/Rakefile b/Rakefile index c87729c986..a40e488df7 100644 --- a/Rakefile +++ b/Rakefile @@ -9,7 +9,7 @@ require 'puppet-strings/tasks' if Gem.loaded_specs.key? 'puppet-strings' def changelog_user return unless Rake.application.top_level_tasks.include? "changelog" - returnVal = nil || JSON.load(File.read('metadata.json'))['author'] + returnVal = "puppetlabs" || JSON.load(File.read('metadata.json'))['author'] raise "unable to find the changelog_user in .sync.yml, or the author in metadata.json" if returnVal.nil? puts "GitHubChangelogGenerator user:#{returnVal}" returnVal @@ -50,6 +50,7 @@ if Gem.loaded_specs.key? 'github_changelog_generator' raise "Set CHANGELOG_GITHUB_TOKEN environment variable eg 'export CHANGELOG_GITHUB_TOKEN=valid_token_here'" if Rake.application.top_level_tasks.include? "changelog" and ENV['CHANGELOG_GITHUB_TOKEN'].nil? config.user = "#{changelog_user}" config.project = "#{changelog_project}" + config.max_issues = 500 config.future_release = "#{changelog_future_release}" config.exclude_labels = ['maintenance'] config.header = "# Change log\n\nAll 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)." diff --git a/metadata.json b/metadata.json index 11c710b417..8f8e381b9d 100644 --- a/metadata.json +++ b/metadata.json @@ -96,5 +96,5 @@ ], "pdk-version": "3.0.0", "template-url": "https://github.com/puppetlabs/pdk-templates#main", - "template-ref": "heads/main-0-g017b84e" + "template-ref": "heads/main-0-g01c6a19" } From 29ef7ffaca506975865f8e0812da48a16a1a5046 Mon Sep 17 00:00:00 2001 From: Jeffrey Clark Date: Tue, 19 Dec 2023 11:53:04 -0600 Subject: [PATCH 12/69] support for a custom apt source release Useful in cases where postgresql has archived support for the platform. --- data/os/Ubuntu/18.04.yaml | 3 +++ manifests/globals.pp | 3 +++ manifests/repo.pp | 1 + manifests/repo/apt_postgresql_org.pp | 6 ++++-- spec/classes/repo_spec.rb | 23 +++++++++++++++++++++++ 5 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 data/os/Ubuntu/18.04.yaml diff --git a/data/os/Ubuntu/18.04.yaml b/data/os/Ubuntu/18.04.yaml new file mode 100644 index 0000000000..7d66bfac7e --- /dev/null +++ b/data/os/Ubuntu/18.04.yaml @@ -0,0 +1,3 @@ +--- +postgresql::repo::baseurl: https://apt-archive.postgresql.org/pub/repos/apt/ +postgresql::repo::release: "%{facts.os.distro.codename}-pgdg-archive" diff --git a/manifests/globals.pp b/manifests/globals.pp index 381da29b26..a193a962c8 100644 --- a/manifests/globals.pp +++ b/manifests/globals.pp @@ -60,6 +60,7 @@ # # @param repo_baseurl Sets the baseurl for the PostgreSQL repository. Useful if you host your own mirror of the repository. # @param yum_repo_commonurl Sets the url for the PostgreSQL common Yum repository. Useful if you host your own mirror of the YUM repository. +# @param apt_source_release Overrides the default release for the apt source. # # @param needs_initdb # Explicitly calls the initdb operation after the server package is installed and before the PostgreSQL service is started. @@ -150,6 +151,7 @@ Optional[String[1]] $repo_proxy = undef, Optional[String[1]] $repo_baseurl = undef, Optional[String[1]] $yum_repo_commonurl = undef, + Optional[String[1]] $apt_source_release = undef, Optional[Boolean] $needs_initdb = undef, @@ -271,6 +273,7 @@ proxy => $repo_proxy, baseurl => $repo_baseurl, commonurl => $yum_repo_commonurl, + release => $apt_source_release, } } diff --git a/manifests/repo.pp b/manifests/repo.pp index 88c27b5e6f..b33b699e76 100644 --- a/manifests/repo.pp +++ b/manifests/repo.pp @@ -1,6 +1,7 @@ # @api private class postgresql::repo ( Optional[String[1]] $version = undef, + Optional[String[1]] $release = undef, Optional[String[1]] $proxy = undef, Optional[String[1]] $baseurl = undef, Optional[String[1]] $commonurl = undef, diff --git a/manifests/repo/apt_postgresql_org.pp b/manifests/repo/apt_postgresql_org.pp index 31b591a0f0..de72f92458 100644 --- a/manifests/repo/apt_postgresql_org.pp +++ b/manifests/repo/apt_postgresql_org.pp @@ -7,16 +7,18 @@ # http://www.postgresql.org/download/linux/debian/ # $default_baseurl = 'https://apt.postgresql.org/pub/repos/apt/' - $_baseurl = pick($postgresql::repo::baseurl, $default_baseurl) + $default_release = "${facts['os']['distro']['codename']}-pgdg" + $_release = pick($postgresql::repo::release, $default_release) + apt::pin { 'apt_postgresql_org': originator => 'apt.postgresql.org', priority => 500, } -> apt::source { 'apt.postgresql.org': location => $_baseurl, - release => "${facts['os']['distro']['codename']}-pgdg", + release => $_release, repos => 'main', architecture => $facts['os']['architecture'], key => { diff --git a/spec/classes/repo_spec.rb b/spec/classes/repo_spec.rb index 3399203f3a..0414501a72 100644 --- a/spec/classes/repo_spec.rb +++ b/spec/classes/repo_spec.rb @@ -9,5 +9,28 @@ it 'instantiates apt_postgresql_org class' do expect(subject).to contain_class('postgresql::repo::apt_postgresql_org') end + + it { + is_expected.to contain_apt__source('apt.postgresql.org') + .with_location('https://apt.postgresql.org/pub/repos/apt/') + .with_release("#{facts[:os]['distro']['codename']}-pgdg") + } + + it { is_expected.to contain_apt__pin('apt_postgresql_org') } + end + + describe 'with custom baseurl and release' do + let(:params) do + { + baseurl: 'https://apt-archive.postgresql.org/pub/repos/apt/', + release: 'bionic-pgdg-archive', + } + end + + it { + is_expected.to contain_apt__source('apt.postgresql.org') + .with_location(params[:baseurl]) + .with_release(params[:release]) + } end end From c206bea5c51a8f32373a29e2887e74a4566dd1f0 Mon Sep 17 00:00:00 2001 From: VAOL Date: Thu, 4 Jan 2024 10:18:57 +0100 Subject: [PATCH 13/69] update GPG key --- files/RPM-GPG-KEY-PGDG | 67 ++++++++++++++++------------ files/RPM-GPG-KEY-PGDG-common | 41 +++++++++++++++++ manifests/repo/yum_postgresql_org.pp | 17 +++++-- 3 files changed, 93 insertions(+), 32 deletions(-) create mode 100644 files/RPM-GPG-KEY-PGDG-common diff --git a/files/RPM-GPG-KEY-PGDG b/files/RPM-GPG-KEY-PGDG index 065274e0d9..a6f86f350a 100644 --- a/files/RPM-GPG-KEY-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8Lp +a28WEXpHZcam43RDMzLMUvJBWem474APx5674EZYX+994lT2cNSAFrnJK956lKmc +ZdzzKuMTcIVGyRF6+KXCmScLAyQks8lHuTJb+AA4eseZnbOsnwnA1xuVfYIfMF/F +bLlR7vl5Autmgnz1SdCaUqIp4MO54GZOgh4MjVadsxIWj8H0cN3uTfukuW4A0+dP +d0YrOKb52Mnejh7x39qWIsMtT8DgcufGcVsuVhC/5LCiHB3pB73J9SMxBafcyGyK +XfLFL5FoDkKTU5KkBfqMQ4k//27mLbJ4kWxHHtNsvnn/6a5m7rRYxFD4dxBWn1CU +BpMjf3m9B3xLc7lKlQZiLLNC7p15gHS51yMvCGxCaHcAEQEAAYkBtgQYAQgAIBYh +BNS/CK5noLTHodvM0kC8orQItA0gBQJlga/BAhsMAAoJEEC8orQItA0guy0L/1ze +AHxV8pxPawOIlgDWoALLb/tqvmG+yz8SN5IWDfvMkMW5kbVoY8zi9SnJtOHVULBC +sdiYN4Dn/Ox1eLlW50F4Z76RI2r/O9rBlHzUk/jAQOcDDCRWjj4a+pYX9I4atU6e ++qOOzxMBsFD0vK84NYJ6caC0LHR64xWnyvXStkDEPSzgHhAlhdn9oTqbIoXuDhSx +zBVSXyowi+cBL8tNsAH4Zlj0li1Gii6bM4DFseQGhKIiTFbx1HD47DT6Pu0X2PSA +pIuZ47n8rP2uTLCYjtnfpXbMwmVOXWxIojhUqIceF+KRr4vRsspSbMxMKg0yeGka +RfQX29x8baM4mdKVBmU9KQxRgno6lcks14STnawqf6o9nHxKp80VQrcNTsYHlq2B +PGAanK8G4WeYojQWCQHBi73qCoTERMpBG73gpTIr836TBinGZaSZ8I1deUS89Hnw +A62QO1TS57zxMTrstzaawLoCIHTqyJ2VeZrVC1INV4ENnyVsud3NaZtfWuIk7Q== +=Elfg +-----END PGP PUBLIC KEY BLOCK----- \ No newline at end of file diff --git a/files/RPM-GPG-KEY-PGDG-common b/files/RPM-GPG-KEY-PGDG-common new file mode 100644 index 0000000000..fae9ac829e --- /d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zuTApUQAC26Lo6T0SOIc7COyshuhZe90IK/cRMuDuvf+8TqWBOE2sMJ0 +2WNS8In5xWItAfoepmFLSOeWbCHo/yzuVFFI7Oo4DJ5cvKJ+Vo3iAWl8RPsN6iKE +Ocmphnc2clno8y4lSc4NckEbL+teZZyww12kHph5NUDReITO4H/4XGEpq4PATT6P +9aMDQQVK4GpmIZ6pLn+yYOV/ZLkHIcJUBVPjLtds5FOsVEpX4JaMowzk4jT6lp/F +7inS2V/87DcrYMl+NcBm09BZ6M4X1OYEumq7qXKtScmHAfp2yG2A1lJ5RtXrSQ== +=fPP0 +-----END PGP PUBLIC KEY BLOCK----- diff --git a/manifests/repo/yum_postgresql_org.pp b/manifests/repo/yum_postgresql_org.pp index be7e26820b..b2d5e5853b 100644 --- a/manifests/repo/yum_postgresql_org.pp +++ b/manifests/repo/yum_postgresql_org.pp @@ -1,8 +1,9 @@ # @api private class postgresql::repo::yum_postgresql_org inherits postgresql::repo { - $version_parts = split($postgresql::repo::version, '[.]') - $package_version = "${version_parts[0]}${version_parts[1]}" - $gpg_key_path = "/etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-${package_version}" + $version_parts = split($postgresql::repo::version, '[.]') + $package_version = "${version_parts[0]}${version_parts[1]}" + $gpg_key_path = "/etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-${package_version}" + $gpg_key_path_common = '/etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-common' file { $gpg_key_path: content => file('postgresql/RPM-GPG-KEY-PGDG'), @@ -12,6 +13,14 @@ before => Yumrepo['yum.postgresql.org'], } + file { $gpg_key_path_common: + content => file('postgresql/RPM-GPG-KEY-PGDG-common'), + owner => 'root', + group => 'root', + mode => '0644', + before => Yumrepo['pgdg-common'], + } + if($facts['os']['name'] == 'Fedora') { $label1 = 'fedora' $label2 = $label1 @@ -39,7 +48,7 @@ baseurl => $_commonurl, enabled => 1, gpgcheck => 1, - gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-${package_version}", + gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-common', proxy => $postgresql::repo::proxy, } From 44b74f3a469d8aa960abded99cbde140131f9708 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Wed, 3 Jan 2024 14:39:23 -1000 Subject: [PATCH 14/69] Remove non-portable source commands `source(1)` is a bashism and is equivalent to the portable `.(1)`, but as each command is run in a new shell, spawning a shell to source a file and exit is at best noop. Some SUT used by acceptance tests do not use bash(1) as the default shell (e.g. Ubuntu 22.04 ARM), which cause CI failures because `source` is not found (127 exit code): ``` 1) postgresql task sql task sets up a postgres db On host `104.154.182.99' Failure/Error: LitmusHelper.instance.run_shell('source /etc/profile.d/my-custom.lang.sh') RuntimeError: shell failed `source /etc/profile.d/my-custom.lang.sh` ====== [{"target"=>"104.154.182.99", "action"=>"command", "object"=>"source /etc/profile.d/my-custom.lang.sh", "status"=>"failure", "value"=>{"stdout"=>"", "stderr"=>"sh: 1: source: not found\n", "merged_output"=>"sh: 1: source: not found\n", "exit_code"=>127, "_error"=>{"kind"=>"puppetlabs.tasks/command-error", "issue_code"=>"COMMAND_ERROR", "msg"=>"The command failed with exit code 127", "details"=>{"exit_code"=>127}}}}] # ./vendor/bundle/ruby/2.7.0/gems/puppet_litmus-1.3.0/lib/puppet_litmus/puppet_helpers.rb:206:in `run_shell' # ./spec/spec_helper_acceptance_local.rb:30:in `export_locales' # ./spec/acceptance/sql_task_spec.rb:17:in `block (3 levels) in ' 2) postgresql task sql task execute some sql On host `104.154.182.99' Failure/Error: result = run_bolt_task('postgresql::sql', 'sql' => 'SELECT count(table_name) FROM information_schema.tables;', 'host' => 'localhost', 'user' => 'root1', 'password' => 'password', 'database' => 'spec1') RuntimeError: task failed `postgresql::sql` ====== [{"target"=>"104.154.182.99", "action"=>"task", "object"=>"postgresql::sql", "status"=>"failure", "value"=>{"status"=>"failure", "error"=>"psql: error: connection to server at \"localhost\" (127.0.0.1), port 5432 failed: FATAL: password authentication failed for user \"root1\"\nconnection to server at \"localhost\" (127.0.0.1), port 5432 failed: FATAL: password authentication failed for user \"root1\"\n", "_error"=>{"kind"=>"puppetlabs.tasks/task-error", "issue_code"=>"TASK_ERROR", "msg"=>"The task failed with exit code 1", "details"=>{"exit_code"=>1}}}}] # ./vendor/bundle/ruby/2.7.0/gems/puppet_litmus-1.3.0/lib/puppet_litmus/puppet_helpers.rb:299:in `run_bolt_task' # ./spec/acceptance/sql_task_spec.rb:23:in `block (3 levels) in ' Finished in 17 minutes 2 seconds (files took 3.36 seconds to load) 59 examples, 2 failures, 10 pending Failed examples: rspec ./spec/acceptance/sql_task_spec.rb:16 # postgresql task sql task sets up a postgres db rspec ./spec/acceptance/sql_task_spec.rb:21 # postgresql task sql task execute some sql ``` Because we set variables in profile files, assume they are sourced during shell startup and will be available to next spawned shells. --- spec/spec_helper_acceptance_local.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/spec/spec_helper_acceptance_local.rb b/spec/spec_helper_acceptance_local.rb index 4af007d09c..ebe3da6556 100644 --- a/spec/spec_helper_acceptance_local.rb +++ b/spec/spec_helper_acceptance_local.rb @@ -27,9 +27,7 @@ def export_locales(locale) LitmusHelper.instance.run_shell("echo export LANGUAGE=#{locale} >> /etc/profile.d/my-custom.lang.sh") LitmusHelper.instance.run_shell('echo export LC_COLLATE=C >> /etc/profile.d/my-custom.lang.sh') LitmusHelper.instance.run_shell("echo export LC_CTYPE=#{locale} >> /etc/profile.d/my-custom.lang.sh") - LitmusHelper.instance.run_shell('source /etc/profile.d/my-custom.lang.sh') LitmusHelper.instance.run_shell('echo export LC_ALL="C" >> ~/.bashrc') - LitmusHelper.instance.run_shell('source ~/.bashrc') end def pre_run From 4a00a01a711bc49f3047b782593bb1c6a25fbaf3 Mon Sep 17 00:00:00 2001 From: VAOL Date: Fri, 5 Jan 2024 08:41:23 +0100 Subject: [PATCH 15/69] specific GPG key for RH7 --- ...GPG-KEY-PGDG-common => RPM-GPG-KEY-PGDG-7} | 0 manifests/repo/yum_postgresql_org.pp | 26 ++++++++----------- 2 files changed, 11 insertions(+), 15 deletions(-) rename files/{RPM-GPG-KEY-PGDG-common => RPM-GPG-KEY-PGDG-7} (100%) diff --git a/files/RPM-GPG-KEY-PGDG-common b/files/RPM-GPG-KEY-PGDG-7 similarity index 100% rename from files/RPM-GPG-KEY-PGDG-common rename to files/RPM-GPG-KEY-PGDG-7 diff --git a/manifests/repo/yum_postgresql_org.pp b/manifests/repo/yum_postgresql_org.pp index b2d5e5853b..faf9c2ace5 100644 --- a/manifests/repo/yum_postgresql_org.pp +++ b/manifests/repo/yum_postgresql_org.pp @@ -1,24 +1,20 @@ # @api private class postgresql::repo::yum_postgresql_org inherits postgresql::repo { - $version_parts = split($postgresql::repo::version, '[.]') - $package_version = "${version_parts[0]}${version_parts[1]}" - $gpg_key_path = "/etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-${package_version}" - $gpg_key_path_common = '/etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-common' + $version_parts = split($postgresql::repo::version, '[.]') + $package_version = "${version_parts[0]}${version_parts[1]}" + $gpg_key_path = "/etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-${package_version}" - file { $gpg_key_path: - content => file('postgresql/RPM-GPG-KEY-PGDG'), - owner => 'root', - group => 'root', - mode => '0644', - before => Yumrepo['yum.postgresql.org'], + $gpg_key_file = $facts['os']['release']['major'] ? { + '7' => 'postgresql/RPM-GPG-KEY-PGDG-7', + default => 'postgresql/RPM-GPG-KEY-PGDG', } - file { $gpg_key_path_common: - content => file('postgresql/RPM-GPG-KEY-PGDG-common'), + file { $gpg_key_path: + content => file($gpg_key_file), owner => 'root', group => 'root', mode => '0644', - before => Yumrepo['pgdg-common'], + before => Yumrepo['yum.postgresql.org'], } if($facts['os']['name'] == 'Fedora') { @@ -39,7 +35,7 @@ baseurl => $_baseurl, enabled => 1, gpgcheck => 1, - gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-${package_version}", + gpgkey => "file://${gpg_key_path}", proxy => $postgresql::repo::proxy, } @@ -48,7 +44,7 @@ baseurl => $_commonurl, enabled => 1, gpgcheck => 1, - gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-common', + gpgkey => "file://${gpg_key_path}", proxy => $postgresql::repo::proxy, } From 83a9a018db36761380682d3dd949d3b4d31d8096 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Tue, 9 Jan 2024 04:32:10 +0000 Subject: [PATCH 16/69] Release prep v10.0.3 --- CHANGELOG.md | 10 ++++++++++ REFERENCE.md | 9 +++++++++ metadata.json | 2 +- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 09a8743765..d259b3adc9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,16 @@ 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). +## [v10.0.3](https://github.com/puppetlabs/puppetlabs-postgresql/tree/v10.0.3) - 2024-01-09 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/v10.0.2...v10.0.3) + +### Fixed + +- support for a custom apt source release [#1561](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1561) ([h0tw1r3](https://github.com/h0tw1r3)) +- (#1556) Fix Python package name for Ubuntu >= 22.04 [#1557](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1557) ([antaflos](https://github.com/antaflos)) +- Unconfine postgresql_conf [#1551](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1551) ([smortex](https://github.com/smortex)) + ## [v10.0.2](https://github.com/puppetlabs/puppetlabs-postgresql/tree/v10.0.2) - 2023-11-08 [Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/v10.0.1...v10.0.2) diff --git a/REFERENCE.md b/REFERENCE.md index 45c57daaa2..4a2b80dd15 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -202,6 +202,7 @@ The following parameters are available in the `postgresql::globals` class: * [`repo_proxy`](#-postgresql--globals--repo_proxy) * [`repo_baseurl`](#-postgresql--globals--repo_baseurl) * [`yum_repo_commonurl`](#-postgresql--globals--yum_repo_commonurl) +* [`apt_source_release`](#-postgresql--globals--apt_source_release) * [`needs_initdb`](#-postgresql--globals--needs_initdb) * [`encoding`](#-postgresql--globals--encoding) * [`locale`](#-postgresql--globals--locale) @@ -529,6 +530,14 @@ Sets the url for the PostgreSQL common Yum repository. Useful if you host your o Default value: `undef` +##### `apt_source_release` + +Data type: `Optional[String[1]]` + +Overrides the default release for the apt source. + +Default value: `undef` + ##### `needs_initdb` Data type: `Optional[Boolean]` diff --git a/metadata.json b/metadata.json index 8f8e381b9d..74453a0310 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-postgresql", - "version": "10.0.2", + "version": "10.0.3", "author": "puppetlabs", "summary": "Offers support for basic management of PostgreSQL databases.", "license": "Apache-2.0", From d69144a87bb1548571a551a7abacb043301102f8 Mon Sep 17 00:00:00 2001 From: Ramesh Sencha Date: Wed, 13 Mar 2024 20:20:42 +0530 Subject: [PATCH 17/69] (MAINT) - PDK Update --- .github/workflows/release.yml | 2 +- .rubocop.yml | 6 +++ .vscode/extensions.json | 2 +- Gemfile | 16 ++++--- Rakefile | 80 ----------------------------------- metadata.json | 2 +- 6 files changed, 18 insertions(+), 90 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0b7b8a05dd..4b3b80fc80 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,7 +2,7 @@ name: "Publish module" on: workflow_dispatch: - + jobs: release: uses: "puppetlabs/cat-github-actions/.github/workflows/module_release.yml@main" diff --git a/.rubocop.yml b/.rubocop.yml index 7a66e08331..e6bd5af841 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -529,6 +529,8 @@ Lint/DuplicateBranch: Enabled: false Lint/DuplicateMagicComment: Enabled: false +Lint/DuplicateMatchPattern: + Enabled: false Lint/DuplicateRegexpCharacterClassElement: Enabled: false Lint/EmptyBlock: @@ -645,6 +647,8 @@ Style/ComparableClamp: Enabled: false Style/ConcatArrayLiterals: Enabled: false +Style/DataInheritance: + Enabled: false Style/DirEmpty: Enabled: false Style/DocumentDynamicEvalDefinition: @@ -713,6 +717,8 @@ Style/RedundantHeredocDelimiterQuotes: Enabled: false Style/RedundantInitialize: Enabled: false +Style/RedundantLineContinuation: + Enabled: false Style/RedundantSelfAssignmentBranch: Enabled: false Style/RedundantStringEscape: diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 2f1e4f73a5..6da8d472f8 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,6 +1,6 @@ { "recommendations": [ "puppet.puppet-vscode", - "rebornix.Ruby" + "Shopify.ruby-lsp" ] } diff --git a/Gemfile b/Gemfile index 86e337adbc..151435e2c1 100644 --- a/Gemfile +++ b/Gemfile @@ -22,27 +22,29 @@ group :development do gem "racc", '~> 1.4.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) gem "voxpupuli-puppet-lint-plugins", '~> 5.0', require: false gem "facterdb", '~> 1.18', require: false - gem "metadata-json-lint", '~> 3.0', require: false + gem "metadata-json-lint", '~> 4.0', require: false + gem "puppetlabs_spec_helper", '~> 6.0', require: false gem "rspec-puppet-facts", '~> 2.0', require: false - gem "codecov", '~> 0.2', require: false gem "dependency_checker", '~> 1.0.0', require: false gem "parallel_tests", '= 3.12.1', require: false gem "pry", '~> 0.10', require: false - gem "simplecov-console", '~> 0.5', require: false + gem "simplecov-console", '~> 0.9', require: false gem "puppet-debugger", '~> 1.0', require: false - gem "rubocop", '= 1.48.1', require: false + gem "rubocop", '~> 1.50.0', require: false gem "rubocop-performance", '= 1.16.0', require: false gem "rubocop-rspec", '= 2.19.0', require: false + gem "puppet-strings", '~> 4.0', require: false gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw] gem "github_changelog_generator", '= 1.15.2', require: false end group :system_tests do - gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw] - gem "serverspec", '~> 2.41', require: false + gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw] + gem "CFPropertyList", '< 3.0.7', require: false, platforms: [:mswin, :mingw, :x64_mingw] + gem "serverspec", '~> 2.41', require: false end group :release_prep do gem "puppet-strings", '~> 4.0', require: false - gem "puppetlabs_spec_helper", '~> 7.0', require: false + gem "puppetlabs_spec_helper", '~> 6.0', require: false end puppet_version = ENV['PUPPET_GEM_VERSION'] diff --git a/Rakefile b/Rakefile index a40e488df7..32f4fa9e14 100644 --- a/Rakefile +++ b/Rakefile @@ -4,88 +4,8 @@ require 'bundler' require 'puppet_litmus/rake_tasks' if Gem.loaded_specs.key? 'puppet_litmus' require 'puppetlabs_spec_helper/rake_tasks' require 'puppet-syntax/tasks/puppet-syntax' -require 'github_changelog_generator/task' if Gem.loaded_specs.key? 'github_changelog_generator' require 'puppet-strings/tasks' if Gem.loaded_specs.key? 'puppet-strings' -def changelog_user - return unless Rake.application.top_level_tasks.include? "changelog" - returnVal = "puppetlabs" || JSON.load(File.read('metadata.json'))['author'] - raise "unable to find the changelog_user in .sync.yml, or the author in metadata.json" if returnVal.nil? - puts "GitHubChangelogGenerator user:#{returnVal}" - returnVal -end - -def changelog_project - return unless Rake.application.top_level_tasks.include? "changelog" - - returnVal = nil - returnVal ||= begin - metadata_source = JSON.load(File.read('metadata.json'))['source'] - metadata_source_match = metadata_source && metadata_source.match(%r{.*\/([^\/]*?)(?:\.git)?\Z}) - - metadata_source_match && metadata_source_match[1] - end - - raise "unable to find the changelog_project in .sync.yml or calculate it from the source in metadata.json" if returnVal.nil? - - puts "GitHubChangelogGenerator project:#{returnVal}" - returnVal -end - -def changelog_future_release - return unless Rake.application.top_level_tasks.include? "changelog" - returnVal = "v%s" % JSON.load(File.read('metadata.json'))['version'] - raise "unable to find the future_release (version) in metadata.json" if returnVal.nil? - puts "GitHubChangelogGenerator future_release:#{returnVal}" - returnVal -end - PuppetLint.configuration.send('disable_relative') PuppetLint.configuration.send('disable_anchor_resource') PuppetLint.configuration.send('disable_params_empty_string_assignment') - - -if Gem.loaded_specs.key? 'github_changelog_generator' - GitHubChangelogGenerator::RakeTask.new :changelog do |config| - raise "Set CHANGELOG_GITHUB_TOKEN environment variable eg 'export CHANGELOG_GITHUB_TOKEN=valid_token_here'" if Rake.application.top_level_tasks.include? "changelog" and ENV['CHANGELOG_GITHUB_TOKEN'].nil? - config.user = "#{changelog_user}" - config.project = "#{changelog_project}" - config.max_issues = 500 - config.future_release = "#{changelog_future_release}" - config.exclude_labels = ['maintenance'] - config.header = "# Change log\n\nAll 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)." - config.add_pr_wo_labels = true - config.issues = false - config.merge_prefix = "### UNCATEGORIZED PRS; LABEL THEM ON GITHUB" - config.configure_sections = { - "Changed" => { - "prefix" => "### Changed", - "labels" => ["backwards-incompatible"], - }, - "Added" => { - "prefix" => "### Added", - "labels" => ["enhancement", "feature"], - }, - "Fixed" => { - "prefix" => "### Fixed", - "labels" => ["bug", "documentation", "bugfix"], - }, - } - end -else - desc 'Generate a Changelog from GitHub' - task :changelog do - raise < 1.15' - condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.3.0')" -EOM - end -end - diff --git a/metadata.json b/metadata.json index 74453a0310..ba09de478d 100644 --- a/metadata.json +++ b/metadata.json @@ -96,5 +96,5 @@ ], "pdk-version": "3.0.0", "template-url": "https://github.com/puppetlabs/pdk-templates#main", - "template-ref": "heads/main-0-g01c6a19" + "template-ref": "heads/main-0-g4fb29e7" } From a6482468020a9d58d4d2295ae4218f97481d48ad Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Thu, 14 Mar 2024 10:20:45 +0100 Subject: [PATCH 18/69] Fix typo in postgresql_conf provider docs --- lib/puppet/provider/postgresql_conf/ruby.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/puppet/provider/postgresql_conf/ruby.rb b/lib/puppet/provider/postgresql_conf/ruby.rb index ab89864d10..984b42706b 100644 --- a/lib/puppet/provider/postgresql_conf/ruby.rb +++ b/lib/puppet/provider/postgresql_conf/ruby.rb @@ -10,7 +10,7 @@ Puppet::Type.type(:postgresql_conf).provide(:ruby) do desc 'Set keys, values and comments in a postgresql config file.' - # The function pareses the postgresql.conf and figures out which active settings exist in a config file and returns an array of hashes + # The function parses the postgresql.conf and figures out which active settings exist in a config file and returns an array of hashes # def parse_config # open the config file From 2a34104b27fc2854b1ad44c1c62297d533bad0e7 Mon Sep 17 00:00:00 2001 From: Bernhard Miklautz Date: Mon, 25 Mar 2024 07:56:20 +0100 Subject: [PATCH 19/69] Add support for Ubuntu 24.04 ("Noble Numbat") --- manifests/globals.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/manifests/globals.pp b/manifests/globals.pp index a193a962c8..ea025e4f9b 100644 --- a/manifests/globals.pp +++ b/manifests/globals.pp @@ -211,6 +211,7 @@ /^(20.04)$/ => '12', /^(21.04|21.10)$/ => '13', /^(22.04)$/ => '14', + /^(24.04)$/ => '16', default => undef, }, default => undef, From 265724b3fcefcfc05eaa8338818fecc00498de2b Mon Sep 17 00:00:00 2001 From: Bernhard Miklautz Date: Mon, 25 Mar 2024 07:58:24 +0100 Subject: [PATCH 20/69] postgis: support for postgres 16 --- manifests/globals.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/manifests/globals.pp b/manifests/globals.pp index ea025e4f9b..b9adfb4820 100644 --- a/manifests/globals.pp +++ b/manifests/globals.pp @@ -260,6 +260,7 @@ '10' => '2.4', '11' => '3.0', '12' => '3.0', + '16' => '3.4', default => undef, } $globals_postgis_version = $postgis_version ? { From 56dc1d56a00e19f7ab008f745ea72534fe9d8115 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Mon, 25 Mar 2024 13:39:13 +0100 Subject: [PATCH 21/69] Use RequiresMountsFor on datadir It is quite common for the data directory to be on its own mount. Systemd can ensure a directory is mounted before a service starts using RequiresMountsFor[1]: > Takes a space-separated list of absolute paths. Automatically adds > dependencies of type Requires= and After= for all mount units required > to access the specified path. [1]: https://www.freedesktop.org/software/systemd/man/latest/systemd.unit.html#RequiresMountsFor= --- templates/systemd-override.conf.epp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/templates/systemd-override.conf.epp b/templates/systemd-override.conf.epp index 48b02c72f4..e451ce8c88 100644 --- a/templates/systemd-override.conf.epp +++ b/templates/systemd-override.conf.epp @@ -3,6 +3,9 @@ Stdlib::Absolutepath $datadir, Optional[String[1]] $extra_systemd_config, | -%> +[Unit] +RequiresMountsFor=<%= $datadir %> + [Service] Environment=PGPORT=<%= $port %> <%- if $facts['os']['family'] == 'Gentoo' { -%> From 43c21aff1a1e07d8bdc2da211e3503a973ae4034 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Tue, 26 Mar 2024 15:29:25 +0100 Subject: [PATCH 22/69] Add a global password_encryption parameter The function postgresql::password() looks at the default for encryption. If you want to use SCRAM on PostgreSQL < 14 then the default must be overridden, or specified for every use. This parameter allows it to be globally overridden. --- manifests/globals.pp | 5 +++++ manifests/params.pp | 2 +- spec/functions/postgresql_default_spec.rb | 14 ++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/manifests/globals.pp b/manifests/globals.pp index b9adfb4820..6cc149fc3f 100644 --- a/manifests/globals.pp +++ b/manifests/globals.pp @@ -81,6 +81,10 @@ # @param timezone # Sets the default timezone of the postgresql server. The postgresql built-in default is taking the systems timezone information. # +# @param password_encryption +# Specify the type of encryption set for the password. +# Defaults to scram-sha-256 for PostgreSQL >= 14, otherwise md5. +# # @param manage_pg_hba_conf Allow Puppet to manage the pg_hba.conf file. # @param manage_pg_ident_conf Allow Puppet to manage the pg_ident.conf file. # @param manage_recovery_conf Allow Puppet to manage the recovery.conf file. @@ -159,6 +163,7 @@ Optional[String[1]] $locale = undef, Optional[Boolean] $data_checksums = undef, Optional[String[1]] $timezone = undef, + Optional[Postgresql::Pg_password_encryption] $password_encryption = undef, Optional[Boolean] $manage_pg_hba_conf = undef, Optional[Boolean] $manage_pg_ident_conf = undef, diff --git a/manifests/params.pp b/manifests/params.pp index c777b0793c..8441aa829c 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -25,7 +25,7 @@ $manage_selinux = pick($manage_selinux, false) $package_ensure = 'present' $module_workdir = pick($module_workdir,'/tmp') - $password_encryption = versioncmp($version, '14') ? { -1 => 'md5', default => 'scram-sha-256' } + $password_encryption = pick($password_encryption, versioncmp($version, '14') ? { -1 => 'md5', default => 'scram-sha-256' }) $extra_systemd_config = undef $manage_datadir = true $manage_logdir = true diff --git a/spec/functions/postgresql_default_spec.rb b/spec/functions/postgresql_default_spec.rb index 12ecde207e..a1d0cd6d57 100644 --- a/spec/functions/postgresql_default_spec.rb +++ b/spec/functions/postgresql_default_spec.rb @@ -30,5 +30,19 @@ class { 'postgresql::server': # parameter in globals.pp only it { is_expected.to run.with_params('default_connect_settings').and_return({}) } + it { is_expected.to run.with_params('password_encryption').and_return('md5') } + it { is_expected.to run.with_params('a_parameter_that_does_not_exist').and_raise_error(Puppet::ParseError, %r{pick\(\): must receive at least one non empty value}) } + + context 'with overridden values' do + let(:pre_condition) do + <<~PUPPET + class { 'postgresql::globals': + password_encryption => 'scram-sha-256', + } + PUPPET + end + + it { is_expected.to run.with_params('password_encryption').and_return('scram-sha-256') } + end end From 8caa079a5a8cf378aa48c6bc80fcbfa56b8b378f Mon Sep 17 00:00:00 2001 From: Lucien Weller Date: Mon, 18 Mar 2024 18:01:45 +0100 Subject: [PATCH 23/69] Added Fedora 39 support --- manifests/globals.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/globals.pp b/manifests/globals.pp index 6cc149fc3f..99dce13966 100644 --- a/manifests/globals.pp +++ b/manifests/globals.pp @@ -180,7 +180,7 @@ $default_version = $facts['os']['family'] ? { /^(RedHat|Linux)/ => $facts['os']['name'] ? { 'Fedora' => $facts['os']['release']['major'] ? { - /^(38)$/ => '15', + /^(38|39)$/ => '15', /^(36|37)$/ => '14', /^(34|35)$/ => '13', /^(32|33)$/ => '12', From c773e918c1cc5ad338f0faa6dfae8a88cca60246 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Tue, 26 Mar 2024 18:07:58 +0000 Subject: [PATCH 24/69] Release prep v10.1.0 --- CHANGELOG.md | 15 +++++++++++++++ REFERENCE.md | 10 ++++++++++ metadata.json | 2 +- 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d259b3adc9..089acdb208 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,21 @@ 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). +## [v10.1.0](https://github.com/puppetlabs/puppetlabs-postgresql/tree/v10.1.0) - 2024-03-26 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/v10.0.3...v10.1.0) + +### Added + +- Add a global password_encryption parameter [#1584](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1584) ([ekohl](https://github.com/ekohl)) +- Use RequiresMountsFor on datadir [#1582](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1582) ([ekohl](https://github.com/ekohl)) +- Support Ubuntu 24.04 and postgis for postgresql 16 [#1581](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1581) ([bmiklautz](https://github.com/bmiklautz)) +- Add Fedora 39 support [#1580](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1580) ([lweller](https://github.com/lweller)) + +### Other + +- Fix typo in postgresql_conf provider docs [#1579](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1579) ([bastelfreak](https://github.com/bastelfreak)) + ## [v10.0.3](https://github.com/puppetlabs/puppetlabs-postgresql/tree/v10.0.3) - 2024-01-09 [Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/v10.0.2...v10.0.3) diff --git a/REFERENCE.md b/REFERENCE.md index 4a2b80dd15..64fd7e14b9 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -208,6 +208,7 @@ The following parameters are available in the `postgresql::globals` class: * [`locale`](#-postgresql--globals--locale) * [`data_checksums`](#-postgresql--globals--data_checksums) * [`timezone`](#-postgresql--globals--timezone) +* [`password_encryption`](#-postgresql--globals--password_encryption) * [`manage_pg_hba_conf`](#-postgresql--globals--manage_pg_hba_conf) * [`manage_pg_ident_conf`](#-postgresql--globals--manage_pg_ident_conf) * [`manage_recovery_conf`](#-postgresql--globals--manage_recovery_conf) @@ -584,6 +585,15 @@ Sets the default timezone of the postgresql server. The postgresql built-in defa Default value: `undef` +##### `password_encryption` + +Data type: `Optional[Postgresql::Pg_password_encryption]` + +Specify the type of encryption set for the password. +Defaults to scram-sha-256 for PostgreSQL >= 14, otherwise md5. + +Default value: `undef` + ##### `manage_pg_hba_conf` Data type: `Optional[Boolean]` diff --git a/metadata.json b/metadata.json index ba09de478d..eeed477da8 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-postgresql", - "version": "10.0.3", + "version": "10.1.0", "author": "puppetlabs", "summary": "Offers support for basic management of PostgreSQL databases.", "license": "Apache-2.0", From 7185fd28f5a0cae67e95fc44124cf2393ddd47b1 Mon Sep 17 00:00:00 2001 From: Malik Parvez <84777619+malikparvez@users.noreply.github.com> Date: Tue, 2 Apr 2024 21:09:39 +0530 Subject: [PATCH 25/69] Fix mend to run on cron --- .github/workflows/mend.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/mend.yml b/.github/workflows/mend.yml index b4100a5af0..8b5b401847 100644 --- a/.github/workflows/mend.yml +++ b/.github/workflows/mend.yml @@ -1,9 +1,10 @@ name: "mend" on: - pull_request: - branches: - - "main" + pull_request_target: + types: + - opened + - synchronize schedule: - cron: "0 0 * * *" workflow_dispatch: From 3c32db8e7d4ace263ead75e99ae59aa8cdcb7416 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Wed, 3 Apr 2024 11:05:01 +0200 Subject: [PATCH 26/69] client.pp: Purge trailing whitespace --- manifests/client.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index 0b15f91fb5..7aa952fddf 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -1,5 +1,5 @@ # @summary 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. # @@ -9,7 +9,7 @@ # Optional. Absolute path for the postgresql connection validation script. # @param package_name # Sets the name of the PostgreSQL client package. -# @param package_ensure +# @param package_ensure # Ensure the client package is installed class postgresql::client ( Enum['file', 'absent'] $file_ensure = 'file', From 8aadd09228bf06ba6efa7b8bdf0da4fdf6567bf7 Mon Sep 17 00:00:00 2001 From: Kenyon Ralph Date: Tue, 2 Jan 2024 22:15:07 -0800 Subject: [PATCH 27/69] repo/apt_postgresql_org: use modern APT keyrings This makes use of https://github.com/puppetlabs/puppetlabs-apt/pull/1128 to store the public key in /etc/apt/keyrings and add a signed-by option to the sources.list.d entry. --- files/ACCC4CF8.asc | 77 ++++++++++++++++++++++++++++ manifests/repo/apt_postgresql_org.pp | 5 +- metadata.json | 2 +- 3 files changed, 81 insertions(+), 3 deletions(-) create mode 100644 files/ACCC4CF8.asc diff --git a/files/ACCC4CF8.asc b/files/ACCC4CF8.asc new file mode 100644 index 0000000000..8480576ece --- /dev/null +++ b/files/ACCC4CF8.asc @@ -0,0 +1,77 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQINBE6XR8IBEAC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+AgPWIGSec/N27a0KmTTvImV6K6nEjXJey0K2+EYJuIBsYUN +orOGBwDFIhfRk9qGlpgt0KRyguV+AP5qvgry95IrYtrOuE7307SidEbSnvO5ezNe +mE7gT9Z1tM7IMPfmoKph4BfpNoH7aXiQh1Wo+ChdP92hZUtQrY2Nm13cmkxYjQ4Z +gMWfYMC+DA/GooSgZM5i6hYqyyfAuUD9kwRN6BqTbuAUAp+hCWYeN4D88sLYpFh3 +paDYNKJ+Gf7Yyi6gThcV956RUFDH3ys5Dk0vDL9NiWwdebWfRFbzoRM3dyGP889a +OyLzS3mh6nHzZrNGhW73kslSQek8tjKrB+56hXOnb4HaElTZGDvD5wmrrhN94kby +Gtz3cydIohvNO9d90+29h0eGEDYti7j7maHkBKUAwlcPvMg5m3Y= +=DA1T +-----END PGP PUBLIC KEY BLOCK----- diff --git a/manifests/repo/apt_postgresql_org.pp b/manifests/repo/apt_postgresql_org.pp index de72f92458..8acd3d3941 100644 --- a/manifests/repo/apt_postgresql_org.pp +++ b/manifests/repo/apt_postgresql_org.pp @@ -22,8 +22,9 @@ repos => 'main', architecture => $facts['os']['architecture'], key => { - id => 'B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8', - source => 'https://www.postgresql.org/media/keys/ACCC4CF8.asc', + name => 'apt.postgresql.org.asc', + # https://www.postgresql.org/media/keys/ACCC4CF8.asc + content => file("${module_name}/ACCC4CF8.asc"), }, include => { src => false, diff --git a/metadata.json b/metadata.json index eeed477da8..1c741d8086 100644 --- a/metadata.json +++ b/metadata.json @@ -14,7 +14,7 @@ }, { "name": "puppetlabs/apt", - "version_requirement": ">= 2.0.0 < 10.0.0" + "version_requirement": ">= 9.2.0 < 10.0.0" }, { "name": "puppet/systemd", From a72c332ad2c9cdafabd4abc95d340ca75c118c2a Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Wed, 10 Apr 2024 11:07:57 +0200 Subject: [PATCH 28/69] acceptance tests: ensure code is idempotent --- spec/acceptance/server_instance_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/acceptance/server_instance_spec.rb b/spec/acceptance/server_instance_spec.rb index 93192bafb3..d00ce95f83 100644 --- a/spec/acceptance/server_instance_spec.rb +++ b/spec/acceptance/server_instance_spec.rb @@ -156,6 +156,6 @@ class { 'postgresql::server': it 'installs postgres instance test1' do export_locales('en_US.UTF-8 ') - apply_manifest(pp, catch_failures: true) + idempotent_apply(pp) end end From 93bb7d4ff636359ae61a95bfc665bf32447ee8f8 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Wed, 10 Apr 2024 16:58:50 +0200 Subject: [PATCH 29/69] .fixtures.yml: unpin puppet_agent dependency --- .fixtures.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.fixtures.yml b/.fixtures.yml index 9846440fef..fbee13667e 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -1,3 +1,4 @@ +--- fixtures: repositories: apt: "https://github.com/puppetlabs/puppetlabs-apt.git" @@ -7,9 +8,7 @@ fixtures: facts: 'https://github.com/puppetlabs/puppetlabs-facts.git' firewall: "https://github.com/puppetlabs/puppetlabs-firewall.git" provision: "https://github.com/puppetlabs/provision.git" - puppet_agent: - repo: 'https://github.com/puppetlabs/puppetlabs-puppet_agent.git' - ref: v4.13.0 + puppet_agent: 'https://github.com/puppetlabs/puppetlabs-puppet_agent.git' stdlib: "https://github.com/puppetlabs/puppetlabs-stdlib.git" yumrepo_core: "https://github.com/puppetlabs/puppetlabs-yumrepo_core.git" systemd: "https://github.com/voxpupuli/puppet-systemd.git" From 5b0fb8ca454c2d1e33af74cca6247215a968e9bf Mon Sep 17 00:00:00 2001 From: Tomas Barton Date: Thu, 31 Aug 2023 10:22:47 +0200 Subject: [PATCH 30/69] List Debian 12 as supported system --- metadata.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index 1c741d8086..9dfec547ad 100644 --- a/metadata.json +++ b/metadata.json @@ -57,7 +57,8 @@ "operatingsystem": "Debian", "operatingsystemrelease": [ "10", - "11" + "11", + "12" ] }, { From b797bbd00bbefdcf84a6eef95f8df02bf0a2572a Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Thu, 19 Oct 2023 19:28:00 +0200 Subject: [PATCH 31/69] (#1532) Replace ParserError with Puppet::Error I'm not sure how we ended up with ParserError in the provider. This exception doesn't exist in Ruby. Puppet ships ther own exception, Puppet::Error. It probably makes sense to raise that instead. Fixes 179472ba261a7d0847fdb93fdcb1d43741c4cdde Alternative implementation for https://github.com/puppetlabs/puppetlabs-postgresql/pull/1538 --- lib/puppet/provider/postgresql_conf/ruby.rb | 2 +- .../provider/postgresql_conf/ruby_spec.rb | 26 ++++++++++++++++--- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/lib/puppet/provider/postgresql_conf/ruby.rb b/lib/puppet/provider/postgresql_conf/ruby.rb index 984b42706b..7e5db35232 100644 --- a/lib/puppet/provider/postgresql_conf/ruby.rb +++ b/lib/puppet/provider/postgresql_conf/ruby.rb @@ -74,7 +74,7 @@ def write_config(file, lines) # check, if resource exists in postgresql.conf file def exists? select = parse_config.select { |hash| hash[:key] == resource[:key] } - raise ParserError, "found multiple config items of #{resource[:key]} found, please fix this" if select.length > 1 + raise Puppet::Error, "found multiple config items of #{resource[:key]}, please fix this" if select.length > 1 return false if select.empty? @result = select.first diff --git a/spec/unit/provider/postgresql_conf/ruby_spec.rb b/spec/unit/provider/postgresql_conf/ruby_spec.rb index 11800b0fc7..1a5c3e806a 100644 --- a/spec/unit/provider/postgresql_conf/ruby_spec.rb +++ b/spec/unit/provider/postgresql_conf/ruby_spec.rb @@ -4,13 +4,14 @@ provider_class = Puppet::Type.type(:postgresql_conf).provider(:ruby) describe provider_class do - let(:resource) { Puppet::Type.type(:postgresql_conf).new(name: 'foo', value: 'bar') } + let(:resource) { Puppet::Type.type(:postgresql_conf).new(name: 'foo', key: 'foo', value: 'bar') } let(:provider) { resource.provider } before(:each) do allow(provider).to receive(:file_path).and_return('/tmp/foo') allow(provider).to receive(:read_file).and_return('foo = bar') allow(provider).to receive(:write_file).and_return(true) + allow(provider).to receive(:resource).and_return(key: 'your_key', line_number: 1, value: 'foo') end # rubocop:enable RSpec/ReceiveMessages @@ -26,8 +27,27 @@ expect(provider).to respond_to(:add_header) end - it 'has a method exists?' do - expect(provider).to respond_to(:exists?) + describe '#exists?' do + it 'returns true when a matching config item is found' do + config_data = [{ key: 'your_key', value: 'your_value' }] + expect(provider).to receive(:parse_config).and_return(config_data) + + expect(provider.exists?).to be true + end + + it 'returns false when no matching config item is found' do + config_data = [{ key: 'other_key', value: 'other_value' }] + expect(provider).to receive(:parse_config).and_return(config_data) + + expect(provider.exists?).to be false + end + + it 'raises an error when multiple matching config items are found' do + config_data = [{ key: 'your_key', value: 'value1' }, { key: 'your_key', value: 'value2' }] + expect(provider).to receive(:parse_config).and_return(config_data) + + expect { provider.exists? }.to raise_error(Puppet::Error, 'found multiple config items of your_key, please fix this') + end end it 'has a method create' do From 26a3e8ebf4eb566cbf7f0dd89dd072629568c2dd Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 11 Apr 2024 07:40:50 +0000 Subject: [PATCH 32/69] Release prep v10.2.0 --- CHANGELOG.md | 13 +++++++++++++ metadata.json | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 089acdb208..df8d39278e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,19 @@ 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). +## [v10.2.0](https://github.com/puppetlabs/puppetlabs-postgresql/tree/v10.2.0) - 2024-04-11 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/v10.1.0...v10.2.0) + +### Added + +- Use modern APT keyrings on Debian family; require puppetlabs/apt 9.2 [#1563](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1563) ([kenyon](https://github.com/kenyon)) +- List Debian 12 as supported system [#1488](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1488) ([deric](https://github.com/deric)) + +### Fixed + +- acceptance tests: ensure code is idempotent [#1589](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1589) ([bastelfreak](https://github.com/bastelfreak)) + ## [v10.1.0](https://github.com/puppetlabs/puppetlabs-postgresql/tree/v10.1.0) - 2024-03-26 [Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/v10.0.3...v10.1.0) diff --git a/metadata.json b/metadata.json index 9dfec547ad..348ca30e5e 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-postgresql", - "version": "10.1.0", + "version": "10.2.0", "author": "puppetlabs", "summary": "Offers support for basic management of PostgreSQL databases.", "license": "Apache-2.0", From d383a21524178f2ee997cf355a7287610c7c7fa9 Mon Sep 17 00:00:00 2001 From: Simon Hoenscheid Date: Wed, 3 Apr 2024 15:44:09 +0200 Subject: [PATCH 33/69] fix service reload for correctinstance in server::instance::config define --- manifests/server/instance/config.pp | 4 ++-- manifests/server_instance.pp | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/manifests/server/instance/config.pp b/manifests/server/instance/config.pp index d596d0846b..342d8fdba3 100644 --- a/manifests/server/instance/config.pp +++ b/manifests/server/instance/config.pp @@ -88,7 +88,7 @@ group => $group, mode => '0640', warn => true, - notify => Class['postgresql::server::reload'], + notify => Postgresql::Server::Instance::Reload[$name], } if $pg_hba_conf_defaults { @@ -249,7 +249,7 @@ group => $group, mode => '0640', warn => true, - notify => Class['postgresql::server::reload'], + notify => Postgresql::Server::Instance::Reload[$name], } } diff --git a/manifests/server_instance.pp b/manifests/server_instance.pp index 49d2bbb8f7..9f45b419f2 100644 --- a/manifests/server_instance.pp +++ b/manifests/server_instance.pp @@ -66,6 +66,10 @@ port => $config_settings['port'], user => $instance_user, } + postgresql::server::instance::reload { $instance_name: + service_status => $service_settings['service_status'], + service_reload => "systemctl reload ${service_settings['service_name']}.service", + } postgresql::server::instance::passwd { $instance_name: * => $passwd_settings, } From 4cff9edb82d88075ea7fa8b6740ca7522440bbec Mon Sep 17 00:00:00 2001 From: Simon Hoenscheid Date: Wed, 3 Apr 2024 15:49:56 +0200 Subject: [PATCH 34/69] fix service reload/restart for correct nstance in server::instance::reload/systemd define --- manifests/server/instance/reload.pp | 2 +- manifests/server/instance/systemd.pp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/manifests/server/instance/reload.pp b/manifests/server/instance/reload.pp index 53eb5fad99..fd0c750ab2 100644 --- a/manifests/server/instance/reload.pp +++ b/manifests/server/instance/reload.pp @@ -11,6 +11,6 @@ command => $service_reload, onlyif => $service_status, refreshonly => true, - require => Class['postgresql::server::service'], + require => Postgresql::Server::Instance::Service[$name], } } diff --git a/manifests/server/instance/systemd.pp b/manifests/server/instance/systemd.pp index b9a46a2336..9214f2a22a 100644 --- a/manifests/server/instance/systemd.pp +++ b/manifests/server/instance/systemd.pp @@ -32,8 +32,8 @@ extra_systemd_config => $extra_systemd_config, } ), - notify => Class['postgresql::server::service'], - before => Class['postgresql::server::reload'], + notify => Postgresql::Server::Instance::Service[$name], + before => Postgresql::Server::Instance::Reload[$name], } } } From 711b3a1d67c67244c64df2b5fe73efc0dc715741 Mon Sep 17 00:00:00 2001 From: Simon Hoenscheid Date: Wed, 3 Apr 2024 18:10:55 +0200 Subject: [PATCH 35/69] fix service reload/restart for correct instance in server_instance/server::config_entry define --- manifests/server/config_entry.pp | 9 +++++---- manifests/server_instance.pp | 11 ++++++----- spec/classes/server_spec.rb | 2 +- spec/defines/server/config_entry_spec.rb | 2 +- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/manifests/server/config_entry.pp b/manifests/server/config_entry.pp index d17b844a18..9485b71bcb 100644 --- a/manifests/server/config_entry.pp +++ b/manifests/server/config_entry.pp @@ -12,6 +12,7 @@ Optional[Variant[String[1], Numeric, Array[String[1]]]] $value = undef, Stdlib::Absolutepath $path = $postgresql::server::postgresql_conf_path, Optional[String[1]] $comment = undef, + String[1] $instance_name = 'main', ) { # Those are the variables that are marked as "(change requires restart)" # on postgresql.conf. Items are ordered as on postgresql.conf. @@ -72,15 +73,15 @@ versioncmp($postgresql::server::_version, $requires_restart_until[$key]) < 0 )) { Postgresql_conf { - notify => Class['postgresql::server::reload'], + notify => Postgresql::Server::Instance::Reload[$instance_name], } } elsif $postgresql::server::service_restart_on_change { Postgresql_conf { - notify => Class['postgresql::server::service'], + notify => Postgresql::Server::Instance::Service[$instance_name], } } else { Postgresql_conf { - before => Class['postgresql::server::service'], + before => Postgresql::Server::Instance::Service[$instance_name], } } @@ -90,6 +91,6 @@ key => $key, value => $value, comment => $comment, - require => Class['postgresql::server::initdb'], + require => Postgresql::Server::Instance::Initdb[$instance_name], } } diff --git a/manifests/server_instance.pp b/manifests/server_instance.pp index 9f45b419f2..97814b1908 100644 --- a/manifests/server_instance.pp +++ b/manifests/server_instance.pp @@ -88,11 +88,12 @@ $value = $settings['value'] $comment = $settings['comment'] postgresql::server::config_entry { "${entry}_${$instance_name}": - ensure => bool2str($value =~ Undef, 'absent', 'present'), - key => $entry, - value => $value, - comment => $comment, - path => $config_settings['postgresql_conf_path'], + ensure => bool2str($value =~ Undef, 'absent', 'present'), + key => $entry, + value => $value, + comment => $comment, + path => $config_settings['postgresql_conf_path'], + instance_name => $instance_name, } } $pg_hba_rules.each |String[1] $rule_name, Postgresql::Pg_hba_rule $rule| { diff --git a/spec/classes/server_spec.rb b/spec/classes/server_spec.rb index caf592d611..513c3d1760 100644 --- a/spec/classes/server_spec.rb +++ b/spec/classes/server_spec.rb @@ -129,7 +129,7 @@ class { 'postgresql::globals': it { is_expected.to contain_class('postgresql::server') } it { - expect(subject).to contain_Postgresql_conf('data_directory_for_instance_main').that_notifies('Class[postgresql::server::service]') + expect(subject).to contain_Postgresql_conf('data_directory_for_instance_main').that_notifies('Postgresql::Server::Instance::Service[main]') } it { is_expected.to contain_postgresql__server__config_entry('data_directory_for_instance_main') } diff --git a/spec/defines/server/config_entry_spec.rb b/spec/defines/server/config_entry_spec.rb index 8b13e020bd..243e2ea5e9 100644 --- a/spec/defines/server/config_entry_spec.rb +++ b/spec/defines/server/config_entry_spec.rb @@ -76,7 +76,7 @@ expect(subject).to contain_postgresql_conf('unix_socket_directories') .with(name: 'unix_socket_directories', value: '/var/pgsql, /opt/postgresql, /root/') - .that_notifies('Class[postgresql::server::service]') + .that_notifies('Postgresql::Server::Instance::Service[main]') end end end From 25d42a32bfc139f5007cb0fb6462ab31dffe3a98 Mon Sep 17 00:00:00 2001 From: Simon Hoenscheid Date: Wed, 3 Apr 2024 19:58:52 +0200 Subject: [PATCH 36/69] add parameter documentation --- manifests/server/config_entry.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/manifests/server/config_entry.pp b/manifests/server/config_entry.pp index 9485b71bcb..e6460659a2 100644 --- a/manifests/server/config_entry.pp +++ b/manifests/server/config_entry.pp @@ -5,6 +5,7 @@ # @param value Defines the value for the setting. # @param path Path for postgresql.conf # @param comment Defines the comment for the setting. The # is added by default. +# @param instance_name The name of the instance. # define postgresql::server::config_entry ( Enum['present', 'absent'] $ensure = 'present', From 79d8430f648e0dea6b9c2fe0dfec9847b78374a3 Mon Sep 17 00:00:00 2001 From: Simon Hoenscheid Date: Wed, 17 Apr 2024 14:14:57 +0200 Subject: [PATCH 37/69] changing database.pp service dependency --- manifests/server/database.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/server/database.pp b/manifests/server/database.pp index 7d95e76056..48cd44103b 100644 --- a/manifests/server/database.pp +++ b/manifests/server/database.pp @@ -72,7 +72,7 @@ postgresql_psql { "CREATE DATABASE \"${dbname}\"": command => "CREATE DATABASE \"${dbname}\" WITH ${template_option} ${encoding_option} ${locale_option} ${tablespace_option}", unless => "SELECT 1 FROM pg_database WHERE datname = '${dbname}'", - require => Class['postgresql::server::service'], + require => Postgresql::Server::Instance::Service[$instance], } # This will prevent users from connecting to the database unless they've been From e51f3d97fe2a195f9d5e2d52c191d3867bd0b0f1 Mon Sep 17 00:00:00 2001 From: Simon Hoenscheid Date: Wed, 24 Apr 2024 15:41:12 +0200 Subject: [PATCH 38/69] fix service dependency issue --- manifests/server/database_grant.pp | 3 +++ manifests/server/db.pp | 3 +++ manifests/server/table_grant.pp | 3 +++ manifests/server_instance.pp | 11 +++++++---- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/manifests/server/database_grant.pp b/manifests/server/database_grant.pp index 3becf35975..c4a7c67ca1 100644 --- a/manifests/server/database_grant.pp +++ b/manifests/server/database_grant.pp @@ -9,6 +9,7 @@ # @param psql_group Overrides the default postgres user group to be used for related files in the file system. # @param connect_settings Specifies a hash of environment variables used when connecting to a remote server. # @param port Port to use when connecting. +# @param instance The name of the Postgresql database instance. define postgresql::server::database_grant ( Enum['ALL', 'CREATE', 'CONNECT', 'TEMPORARY', 'TEMP', 'all', 'create', 'connect', 'temporary', 'temp'] $privilege, String[1] $db, @@ -19,6 +20,7 @@ Hash $connect_settings = $postgresql::server::default_connect_settings, String[1] $psql_group = $postgresql::server::group, Stdlib::Port $port = $postgresql::server::port, + String[1] $instance = 'main', ) { postgresql::server::grant { "database:${name}": ensure => $ensure, @@ -32,5 +34,6 @@ group => $psql_group, port => $port, connect_settings => $connect_settings, + instance => $instance, } } diff --git a/manifests/server/db.pp b/manifests/server/db.pp index 513e548ed7..9542dcc618 100644 --- a/manifests/server/db.pp +++ b/manifests/server/db.pp @@ -44,6 +44,7 @@ port => $port, user => $psql_user, group => $psql_group, + instance => $instance, } } @@ -54,6 +55,7 @@ psql_user => $psql_user, psql_group => $psql_group, before => Postgresql::Server::Database[$dbname], + instance => $instance, } } @@ -65,6 +67,7 @@ port => $port, psql_user => $psql_user, psql_group => $psql_group, + instance => $instance, } -> Postgresql_conn_validator<| db_name == $dbname |> } diff --git a/manifests/server/table_grant.pp b/manifests/server/table_grant.pp index 9168dd9ce0..719460fd22 100644 --- a/manifests/server/table_grant.pp +++ b/manifests/server/table_grant.pp @@ -12,6 +12,7 @@ # @param psql_user Specifies the OS user for running psql. # @param connect_settings Specifies a hash of environment variables used when connecting to a remote server. # @param onlyif_exists Create grant only if it doesn't exist. +# @param instance The name of the Postgresql database instance. define postgresql::server::table_grant ( Enum['ALL', 'SELECT', 'INSERT', 'UPDATE', 'DELETE', 'TRUNCATE', 'REFERENCES', 'TRIGGER', 'all', 'select', 'insert', 'update', 'delete', 'truncate', 'references', 'trigger'] $privilege, @@ -24,6 +25,7 @@ Optional[String[1]] $psql_user = undef, Optional[Hash] $connect_settings = undef, Boolean $onlyif_exists = false, + String[1] $instance = 'main', ) { postgresql::server::grant { "table:${name}": ensure => $ensure, @@ -37,5 +39,6 @@ psql_user => $psql_user, onlyif_exists => $onlyif_exists, connect_settings => $connect_settings, + instance => $instance, } } diff --git a/manifests/server_instance.pp b/manifests/server_instance.pp index 97814b1908..5ef8dec527 100644 --- a/manifests/server_instance.pp +++ b/manifests/server_instance.pp @@ -113,10 +113,11 @@ } $databases.each |$database, $database_details| { postgresql::server::database { $database: - * => $database_details, - user => $instance_user, - group => $instance_group, - port => $config_settings['port'], + * => $database_details, + user => $instance_user, + group => $instance_group, + port => $config_settings['port'], + instance => $instance_name, } } $database_grants.each |$db_grant_title, $dbgrants| { @@ -125,6 +126,7 @@ psql_user => $instance_user, psql_group => $instance_group, port => $config_settings['port'], + instance => $instance_name, } } $table_grants.each |$table_grant_title, $tgrants| { @@ -132,6 +134,7 @@ * => $tgrants, psql_user => $instance_user, port => $config_settings['port'], + instance => $instance_name, } } } From dc7011bf90ec55a82f3ee711a474c96f6c5e23dd Mon Sep 17 00:00:00 2001 From: Christoph Maser Date: Sun, 5 May 2024 17:26:12 +0200 Subject: [PATCH 39/69] allow puppet-systemd version 7 --- metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index 348ca30e5e..689ab45afc 100644 --- a/metadata.json +++ b/metadata.json @@ -18,7 +18,7 @@ }, { "name": "puppet/systemd", - "version_requirement": ">= 4.0.1 < 7.0.0" + "version_requirement": ">= 4.0.1 < 8.0.0" }, { "name": "puppetlabs/concat", From 822d4f9db587f6ae320441116e2663e558fe9c9e Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Wed, 8 May 2024 02:28:22 +0000 Subject: [PATCH 40/69] Release prep v10.3.0 --- CHANGELOG.md | 21 ++++++++++++++++++++- REFERENCE.md | 27 +++++++++++++++++++++++++++ metadata.json | 2 +- 3 files changed, 48 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index df8d39278e..c0f2ff5598 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,18 @@ 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). +## [v10.3.0](https://github.com/puppetlabs/puppetlabs-postgresql/tree/v10.3.0) - 2024-05-08 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/v10.2.0...v10.3.0) + +### Added + +- allow puppet-systemd version 7 [#1595](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1595) ([TheMeier](https://github.com/TheMeier)) + +### Fixed + +- Fix instance reload [#1588](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1588) ([SimonHoenscheid](https://github.com/SimonHoenscheid)) + ## [v10.2.0](https://github.com/puppetlabs/puppetlabs-postgresql/tree/v10.2.0) - 2024-04-11 [Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/v10.1.0...v10.2.0) @@ -65,6 +77,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/v9.2.0...v10.0.0) ### Changed + - postgis: Drop EL5 leftovers and fix package name for Fedora [#1521](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1521) ([bastelfreak](https://github.com/bastelfreak)) - Drop EoL SLES 11.4 code [#1520](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1520) ([bastelfreak](https://github.com/bastelfreak)) - Drop code for Debian without systemd [#1514](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1514) ([bastelfreak](https://github.com/bastelfreak)) @@ -165,6 +178,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/v8.3.0...v9.0.0) ### Changed + - (CONT-792) - Add Puppet 8/Drop Puppet 6 [#1414](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1414) ([jordanbreen28](https://github.com/jordanbreen28)) ## [v8.3.0](https://github.com/puppetlabs/puppetlabs-postgresql/tree/v8.3.0) - 2023-04-21 @@ -244,6 +258,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/v7.5.0...v8.0.0) ### Changed + - Support setting default_privileges on all schemas [#1298](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1298) ([fish-face](https://github.com/fish-face)) ### Added @@ -251,7 +266,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - add default version for Fedora 35 [#1317](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1317) ([jflorian](https://github.com/jflorian)) - add scram-sha-256 support [#1313](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1313) ([fe80](https://github.com/fe80)) - add support for Ubuntu Hirsute and Impish [#1312](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1312) ([nicholascioli](https://github.com/nicholascioli)) -- Allow systemd to mask postgresql service file [#1310](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1310) ([kim-sondrup](https://github.com/kim-sondrup)) +- Allow systemd to mask postgresql service file [#1310](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1310) ([kimsondrup](https://github.com/kimsondrup)) - Make ::contrib a noop on OSes without a contrib package [#1309](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1309) ([carlosduelo](https://github.com/carlosduelo)) - pdksync - (IAC-1753) - Add Support for AlmaLinux 8 [#1308](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1308) ([david22swan](https://github.com/david22swan)) - MODULES-11201: add service_name for Ubuntu 18.04 and later [#1306](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1306) ([moritz-makandra](https://github.com/moritz-makandra)) @@ -354,6 +369,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/v6.10.2...v7.0.0) ### Changed + - pdksync - (MAINT) Remove SLES 11 support [#1247](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1247) ([sanfrancrisko](https://github.com/sanfrancrisko)) - pdksync - (MAINT) Remove RHEL 5 family support [#1246](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1246) ([sanfrancrisko](https://github.com/sanfrancrisko)) - pdksync - Remove Puppet 5 from testing and bump minimal version to 6.0.0 [#1238](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1238) ([carabasdaniel](https://github.com/carabasdaniel)) @@ -520,6 +536,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [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)) @@ -618,6 +635,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/5.4.0...5.5.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 @@ -703,6 +721,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/4.9.0...5.0.0) ### Changed + - Unset default log_line_prefix [#870](https://github.com/puppetlabs/puppetlabs-postgresql/pull/870) ([hasegeli](https://github.com/hasegeli)) - Let listen_addresses be defined independently [#865](https://github.com/puppetlabs/puppetlabs-postgresql/pull/865) ([hasegeli](https://github.com/hasegeli)) diff --git a/REFERENCE.md b/REFERENCE.md index 64fd7e14b9..247b58c952 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -1546,6 +1546,7 @@ The following parameters are available in the `postgresql::server::config_entry` * [`value`](#-postgresql--server--config_entry--value) * [`path`](#-postgresql--server--config_entry--path) * [`comment`](#-postgresql--server--config_entry--comment) +* [`instance_name`](#-postgresql--server--config_entry--instance_name) ##### `ensure` @@ -1587,6 +1588,14 @@ Defines the comment for the setting. The # is added by default. Default value: `undef` +##### `instance_name` + +Data type: `String[1]` + +The name of the instance. + +Default value: `'main'` + ### `postgresql::server::database` Define for creating a database. @@ -1748,6 +1757,7 @@ The following parameters are available in the `postgresql::server::database_gran * [`psql_group`](#-postgresql--server--database_grant--psql_group) * [`connect_settings`](#-postgresql--server--database_grant--connect_settings) * [`port`](#-postgresql--server--database_grant--port) +* [`instance`](#-postgresql--server--database_grant--instance) ##### `privilege` @@ -1815,6 +1825,14 @@ Port to use when connecting. Default value: `$postgresql::server::port` +##### `instance` + +Data type: `String[1]` + +The name of the Postgresql database instance. + +Default value: `'main'` + ### `postgresql::server::db` Define for conveniently creating a role, database and assigning the correct permissions. @@ -3970,6 +3988,7 @@ The following parameters are available in the `postgresql::server::table_grant` * [`psql_user`](#-postgresql--server--table_grant--psql_user) * [`connect_settings`](#-postgresql--server--table_grant--connect_settings) * [`onlyif_exists`](#-postgresql--server--table_grant--onlyif_exists) +* [`instance`](#-postgresql--server--table_grant--instance) ##### `privilege` @@ -4049,6 +4068,14 @@ Create grant only if it doesn't exist. Default value: `false` +##### `instance` + +Data type: `String[1]` + +The name of the Postgresql database instance. + +Default value: `'main'` + ### `postgresql::server::tablespace` This module creates tablespace. diff --git a/metadata.json b/metadata.json index 689ab45afc..c5b9d1cb21 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-postgresql", - "version": "10.2.0", + "version": "10.3.0", "author": "puppetlabs", "summary": "Offers support for basic management of PostgreSQL databases.", "license": "Apache-2.0", From de9e9d744ab0a7d7a235691a27e127510f1ed073 Mon Sep 17 00:00:00 2001 From: Malik Parvez <84777619+malikparvez@users.noreply.github.com> Date: Tue, 21 May 2024 21:19:17 +0530 Subject: [PATCH 41/69] ITHELP-87329 : replace pull_request_target with pull_request --- .github/workflows/mend.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/mend.yml b/.github/workflows/mend.yml index 8b5b401847..b4100a5af0 100644 --- a/.github/workflows/mend.yml +++ b/.github/workflows/mend.yml @@ -1,10 +1,9 @@ name: "mend" on: - pull_request_target: - types: - - opened - - synchronize + pull_request: + branches: + - "main" schedule: - cron: "0 0 * * *" workflow_dispatch: From 6cbbd29d99e26c417c761e0d246d161e438da093 Mon Sep 17 00:00:00 2001 From: Malik Parvez <84777619+malikparvez@users.noreply.github.com> Date: Tue, 4 Jun 2024 13:56:05 +0530 Subject: [PATCH 42/69] ITHELP-87329 : replace pull_request_target with pull_request --- .github/workflows/labeller.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/labeller.yml b/.github/workflows/labeller.yml index ee149bf525..0d4870d70b 100644 --- a/.github/workflows/labeller.yml +++ b/.github/workflows/labeller.yml @@ -6,7 +6,7 @@ on: - opened - labeled - unlabeled - pull_request_target: + pull_request: types: - opened - labeled From 1a5ad40561664cfeb7bb61140b5aee9197fe0d87 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Thu, 30 May 2024 17:34:03 +0200 Subject: [PATCH 43/69] Fix spelling of PostgreSQL in a debug statement --- lib/puppet/provider/postgresql_conf/ruby.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/puppet/provider/postgresql_conf/ruby.rb b/lib/puppet/provider/postgresql_conf/ruby.rb index 7e5db35232..d3474a8bff 100644 --- a/lib/puppet/provider/postgresql_conf/ruby.rb +++ b/lib/puppet/provider/postgresql_conf/ruby.rb @@ -36,7 +36,7 @@ def parse_config active_settings.push(attributes_hash) end end - Puppet.debug("DEBUG: parse_config Active Settings found in Postgreql config file: #{active_settings}") + Puppet.debug("DEBUG: parse_config Active Settings found in PostgreSQL config file: #{active_settings}") active_settings end From 9c5e5cec05a6a11396dda816580d86e8bc940636 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Thu, 30 May 2024 17:41:31 +0200 Subject: [PATCH 44/69] Avoid opening the file in postgresql_conf Using File.open without closing it can leak file descriptors. It's actually not needed at all because File.foreach, File.readlines and File.write all accept a filename. This simplifies the code in the process. --- lib/puppet/provider/postgresql_conf/ruby.rb | 29 ++++++++------------- 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/lib/puppet/provider/postgresql_conf/ruby.rb b/lib/puppet/provider/postgresql_conf/ruby.rb index d3474a8bff..3719eb635e 100644 --- a/lib/puppet/provider/postgresql_conf/ruby.rb +++ b/lib/puppet/provider/postgresql_conf/ruby.rb @@ -13,15 +13,13 @@ # The function parses the postgresql.conf and figures out which active settings exist in a config file and returns an array of hashes # def parse_config - # open the config file - file = File.open(resource[:target]) # regex to match active keys, values and comments active_values_regex = %r{^\s*(?[\w.]+)\s*=?\s*(?.*?)(?:\s*#\s*(?.*))?\s*$} # empty array to be filled with hashes active_settings = [] # iterate the file and construct a hash for every matching/active setting # the hash is pushed to the array and the array is returned - File.foreach(file).with_index do |line, index| + File.foreach(resource[:target]).with_index do |line, index| line_number = index + 1 matches = line.match(active_values_regex) if matches @@ -63,12 +61,11 @@ def add_header(lines) # This function writes the config file, it removes the old header, adds a new one and writes the file # - # @param [File] the file object of the postgresql configuration file # @param [Array] lines of the parsed postgresql configuration file - def write_config(file, lines) + def write_config(lines) lines = delete_header(lines) lines = add_header(lines) - File.write(file, lines.join) + File.write(resource[:target], lines.join) end # check, if resource exists in postgresql.conf file @@ -85,23 +82,21 @@ def exists? # remove resource if exists and is set to absent def destroy entry_regex = %r{#{resource[:key]}.*=.*#{resource[:value]}} - file = File.open(resource[:target]) - lines = File.readlines(file) + lines = File.readlines(resource[:target]) lines.delete_if do |entry| entry.match?(entry_regex) end - write_config(file, lines) + write_config(lines) end # create resource if it does not exists def create - file = File.open(resource[:target]) - lines = File.readlines(file) + lines = File.readlines(resource[:target]) new_line = line(key: resource[:key], value: resource[:value], comment: resource[:comment]) lines.push(new_line) - write_config(file, lines) + write_config(lines) end # getter - get value of a resource @@ -116,8 +111,7 @@ def comment # setter - set value of a resource def value=(_value) - file = File.open(resource[:target]) - lines = File.readlines(file) + lines = File.readlines(resource[:target]) active_values_regex = %r{^\s*(?[\w.]+)\s*=?\s*(?.*?)(?:\s*#\s*(?.*))?\s*$} new_line = line(key: resource[:key], value: resource[:value], comment: resource[:comment]) @@ -125,13 +119,12 @@ def value=(_value) matches = line.to_s.match(active_values_regex) lines[index] = new_line if matches && (matches[:key] == resource[:key] && matches[:value] != resource[:value]) end - write_config(file, lines) + write_config(lines) end # setter - set comment of a resource def comment=(_comment) - file = File.open(resource[:target]) - lines = File.readlines(file) + lines = File.readlines(resource[:target]) active_values_regex = %r{^\s*(?[\w.]+)\s*=?\s*(?.*?)(?:\s*#\s*(?.*))?\s*$} new_line = line(key: resource[:key], value: resource[:value], comment: resource[:comment]) @@ -139,7 +132,7 @@ def comment=(_comment) matches = line.to_s.match(active_values_regex) lines[index] = new_line if matches && (matches[:key] == resource[:key] && matches[:comment] != resource[:comment]) end - write_config(file, lines) + write_config(lines) end private From f2b193dd6ff7a0e0375a3ffaa610cd0727620219 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Thu, 30 May 2024 17:43:15 +0200 Subject: [PATCH 45/69] Pass an offset to with_index to calculate line numbers Rather than starting from 0 and always adding 1, this tells with_index to start at 1. --- lib/puppet/provider/postgresql_conf/ruby.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/puppet/provider/postgresql_conf/ruby.rb b/lib/puppet/provider/postgresql_conf/ruby.rb index 3719eb635e..f21caf2b5c 100644 --- a/lib/puppet/provider/postgresql_conf/ruby.rb +++ b/lib/puppet/provider/postgresql_conf/ruby.rb @@ -19,8 +19,7 @@ def parse_config active_settings = [] # iterate the file and construct a hash for every matching/active setting # the hash is pushed to the array and the array is returned - File.foreach(resource[:target]).with_index do |line, index| - line_number = index + 1 + File.foreach(resource[:target]).with_index(1) do |line, line_number| matches = line.match(active_values_regex) if matches value = if matches[:value].to_i.to_s == matches[:value] From 35283af25e0571a69380b42f4f23daffd2abcca2 Mon Sep 17 00:00:00 2001 From: rajat-puppet Date: Mon, 22 Jul 2024 17:31:20 +0530 Subject: [PATCH 46/69] Remove labeller.yml --- .github/workflows/labeller.yml | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 .github/workflows/labeller.yml diff --git a/.github/workflows/labeller.yml b/.github/workflows/labeller.yml deleted file mode 100644 index 0d4870d70b..0000000000 --- a/.github/workflows/labeller.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Labeller - -on: - issues: - types: - - opened - - labeled - - unlabeled - pull_request: - types: - - opened - - labeled - - unlabeled - -jobs: - label: - runs-on: ubuntu-latest - steps: - - - uses: puppetlabs/community-labeller@v1.0.1 - name: Label issues or pull requests - with: - label_name: community - label_color: '5319e7' - org_membership: puppetlabs - fail_if_member: 'true' - token: ${{ secrets.IAC_COMMUNITY_LABELER }} From 2fab228c87336e7915802c9b27cfd31f486d4c69 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Wed, 10 Apr 2024 13:50:30 +0200 Subject: [PATCH 47/69] Add EL9 support --- metadata.json | 12 ++++++++---- spec/acceptance/server_instance_spec.rb | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/metadata.json b/metadata.json index c5b9d1cb21..25d4509af6 100644 --- a/metadata.json +++ b/metadata.json @@ -38,13 +38,15 @@ "operatingsystem": "CentOS", "operatingsystemrelease": [ "7", - "8" + "8", + "9" ] }, { "operatingsystem": "OracleLinux", "operatingsystemrelease": [ - "7" + "7", + "9" ] }, { @@ -79,13 +81,15 @@ { "operatingsystem": "Rocky", "operatingsystemrelease": [ - "8" + "8", + "9" ] }, { "operatingsystem": "AlmaLinux", "operatingsystemrelease": [ - "8" + "8", + "9" ] } ], diff --git a/spec/acceptance/server_instance_spec.rb b/spec/acceptance/server_instance_spec.rb index d00ce95f83..4b8d6a4bb8 100644 --- a/spec/acceptance/server_instance_spec.rb +++ b/spec/acceptance/server_instance_spec.rb @@ -3,7 +3,7 @@ # run a test task require 'spec_helper_acceptance' -describe 'postgresql instance test1', if: os[:family] == 'redhat' && os[:release].start_with?('8') do +describe 'postgresql instance test1', if: os[:family] == 'redhat' && !os[:release].start_with?('7') do pp = <<-MANIFEST # set global defaults class { 'postgresql::globals': @@ -12,7 +12,7 @@ class { 'postgresql::globals': manage_package_repo => false, manage_dnf_module => true, needs_initdb => true, - version => '13', + version => '16', } # stop default main instance class { 'postgresql::server': From 7cc99852c19d12d8108997b5e599c8e35b32aa4d Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Wed, 31 Jul 2024 14:39:26 +0200 Subject: [PATCH 48/69] Fix typo in README: instaces -> instances --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c7189eb025..1ed5f1e1f0 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ creating a new instance has the following advantages: * main instance can be disabled -Here is a profile which can be used to create instaces +Here is a profile which can be used to create instances ```puppet class profiles::postgres ( From 79f9a85e05a4a7bd13c9ac140e24424667464fbb Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Wed, 28 Aug 2024 15:52:27 +0200 Subject: [PATCH 49/69] Fix typos and casing in README --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1ed5f1e1f0..5963b85bf6 100644 --- a/README.md +++ b/README.md @@ -78,10 +78,10 @@ For more details about server configuration parameters, consult the [PostgreSQL This module supports managing multiple instances (the default instance is referred to as 'main' and managed via including the server.pp class) -**NOTE:** This feature is currently tested on Centos 8 Streams/RHEL8 with DNF Modules enabled. Different Linux plattforms and/or the Postgresql.org -packages distribute different Systemd service files or use wrapper scripts with Systemd to start Postgres. Additional adjustmentments are needed to get this working on these plattforms. +**NOTE:** This feature is currently tested on CentOS 8 Streams/RHEL8 with DNF Modules enabled. Different Linux platforms and/or the postgresql.org +packages distribute different systemd service files or use wrapper scripts with systemd to start PostgreSQL. Additional adjustmentments are needed to get this working on these platforms. -#### Working Plattforms +#### Working Platforms * Centos 8 Streams * RHEL 8 From 231e00815c15939768b70da8425e7f81d13d6ba9 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Wed, 28 Aug 2024 15:53:09 +0200 Subject: [PATCH 50/69] Document how to select a version as its own chapter This documents the various ways to set up repositories as well. --- README.md | 48 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 5963b85bf6..8f7141dbb3 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,42 @@ If you get an error message from these commands, your permission settings restri For more details about server configuration parameters, consult the [PostgreSQL Runtime Configuration documentation](http://www.postgresql.org/docs/current/static/runtime-config.html). +#### Selecting a version + +The version is intended to be supplied via `postgresql::globals`. +By default the module tries to derive the version based on the OS facts, but can be overridden. +This is typically used with the official postgresql.org packages: + +```puppet +class { 'postgresql::globals': + manage_package_repo => true, + version => '16', +} + +include postgresql::server +``` + +On EL 8 & 9 you can also use DNF modules: + +```puppet +class { 'postgresql::globals': + manage_dnf_module => true, + version => '16', +} + +include postgresql::server +``` + +If you manage the repositories yourself, overriding the version is sufficient. + +```puppet +class { 'postgresql::globals': + version => '16', +} + +include postgresql::server +``` + ### Configure an instance This module supports managing multiple instances (the default instance is referred to as 'main' and managed via including the server.pp class) @@ -341,18 +377,6 @@ class { 'postgresql::server': } ``` -To use a specific version of the PostgreSQL package: - -```puppet -class { 'postgresql::globals': - manage_package_repo => true, - version => '9.2', -} - -class { 'postgresql::server': -} -``` - ### Manage remote users, roles, and permissions Remote SQL objects are managed using the same Puppet resources as local SQL objects, along with a `$connect_settings` hash. This provides control over how Puppet connects to the remote Postgres instances and which version is used for generating SQL commands. From 831070812bcd7ba46e699d3dadb82440ab11ac9d Mon Sep 17 00:00:00 2001 From: Shubham Shinde Date: Fri, 4 Oct 2024 10:41:31 +0530 Subject: [PATCH 51/69] (CAT-2052) Bump SLES-15 package/product versions - sles-legacy 15.5 version is no longer available in the default repos. Use the os.distro.release.full fact so that we don't have to bump the manually in the future. - Bump postgresql-server version from 14 to 16 since 14 is no longer available in the default repos. --- manifests/globals.pp | 2 +- spec/spec_helper_acceptance_local.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/manifests/globals.pp b/manifests/globals.pp index 99dce13966..b4a7bc290f 100644 --- a/manifests/globals.pp +++ b/manifests/globals.pp @@ -236,7 +236,7 @@ /12\.0/ => '93', /12\.[1-3]/ => '94', /12\.[4-5]/ => '12', - /15\.[0-9]/ => '14', + /15\.[0-9]/ => '16', default => '96', }, 'OpenSuSE' => $facts['os']['release']['full'] ? { diff --git a/spec/spec_helper_acceptance_local.rb b/spec/spec_helper_acceptance_local.rb index ebe3da6556..669741c6c1 100644 --- a/spec/spec_helper_acceptance_local.rb +++ b/spec/spec_helper_acceptance_local.rb @@ -46,8 +46,8 @@ def install_dependencies if $facts['os']['family'] in ['SLES', 'SUSE'] { exec { 'Enable legacy repos': path => '/bin:/usr/bin/:/sbin:/usr/sbin', - command => 'SUSEConnect --product sle-module-legacy/15.5/x86_64', - unless => 'SUSEConnect --status-text | grep sle-module-legacy/15.5/x86_64', + command => "SUSEConnect --product sle-module-legacy/${$facts['os']['distro']['release']['full']}/x86_64", + unless => "SUSEConnect --status-text | grep sle-module-legacy/${$facts['os']['distro']['release']['full']}/x86_64", } package { 'net-tools-deprecated': From 0fb0f3073c1cbb91eb5a6b372a9ecaba019603f8 Mon Sep 17 00:00:00 2001 From: skyamgarp <130442619+skyamgarp@users.noreply.github.com> Date: Wed, 6 Nov 2024 12:37:49 +0530 Subject: [PATCH 52/69] (CAT-2124) Add support for Ubuntu 24 --- metadata.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index 25d4509af6..df225a9c04 100644 --- a/metadata.json +++ b/metadata.json @@ -75,7 +75,8 @@ "operatingsystemrelease": [ "18.04", "20.04", - "22.04" + "22.04", + "24.04" ] }, { From f4bcc9627a533384a43b0459aa739b60b3be7451 Mon Sep 17 00:00:00 2001 From: Amit Karsale Date: Wed, 6 Nov 2024 18:59:26 +0530 Subject: [PATCH 53/69] pdksync - (PF-3525) - pdk update for module --- .gitignore | 7 +++++++ .pdkignore | 7 +++++++ .rubocop.yml | 2 +- Gemfile | 13 ++++++------- metadata.json | 4 ++-- spec/spec_helper.rb | 5 +++-- 6 files changed, 26 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 3f1551212b..2803e566b5 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,7 @@ /spec/fixtures/modules/* /tmp/ /vendor/ +/.vendor/ /convert_report.txt /update_report.txt .DS_Store @@ -26,3 +27,9 @@ .envrc /inventory.yaml /spec/fixtures/litmus_inventory.yaml +.resource_types +.modules +.task_cache.json +.plan_cache.json +.rerun.json +bolt-debug.log diff --git a/.pdkignore b/.pdkignore index 862847a72c..84684be63f 100644 --- a/.pdkignore +++ b/.pdkignore @@ -19,6 +19,7 @@ /spec/fixtures/modules/* /tmp/ /vendor/ +/.vendor/ /convert_report.txt /update_report.txt .DS_Store @@ -26,6 +27,12 @@ .envrc /inventory.yaml /spec/fixtures/litmus_inventory.yaml +.resource_types +.modules +.task_cache.json +.plan_cache.json +.rerun.json +bolt-debug.log /.fixtures.yml /Gemfile /.gitattributes diff --git a/.rubocop.yml b/.rubocop.yml index e6bd5af841..439ea84ee8 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -5,7 +5,7 @@ require: AllCops: NewCops: enable DisplayCopNames: true - TargetRubyVersion: '2.7' + TargetRubyVersion: '2.6' Include: - "**/*.rb" Exclude: diff --git a/Gemfile b/Gemfile index 151435e2c1..7a1566ddb4 100644 --- a/Gemfile +++ b/Gemfile @@ -20,10 +20,10 @@ group :development do gem "json", '= 2.6.1', require: false if Gem::Requirement.create(['>= 3.1.0', '< 3.1.3']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) gem "json", '= 2.6.3', require: false if Gem::Requirement.create(['>= 3.2.0', '< 4.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) gem "racc", '~> 1.4.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "deep_merge", '~> 1.2.2', require: false gem "voxpupuli-puppet-lint-plugins", '~> 5.0', require: false - gem "facterdb", '~> 1.18', require: false + gem "facterdb", '~> 1.18', require: false gem "metadata-json-lint", '~> 4.0', require: false - gem "puppetlabs_spec_helper", '~> 6.0', require: false gem "rspec-puppet-facts", '~> 2.0', require: false gem "dependency_checker", '~> 1.0.0', require: false gem "parallel_tests", '= 3.12.1', require: false @@ -33,19 +33,18 @@ group :development do gem "rubocop", '~> 1.50.0', require: false gem "rubocop-performance", '= 1.16.0', require: false gem "rubocop-rspec", '= 2.19.0', require: false - gem "puppet-strings", '~> 4.0', require: false gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw] gem "github_changelog_generator", '= 1.15.2', require: false end +group :development, :release_prep do + gem "puppet-strings", '~> 4.0', require: false + gem "puppetlabs_spec_helper", '~> 7.0', require: false +end group :system_tests do gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw] gem "CFPropertyList", '< 3.0.7', require: false, platforms: [:mswin, :mingw, :x64_mingw] gem "serverspec", '~> 2.41', require: false end -group :release_prep do - gem "puppet-strings", '~> 4.0', require: false - gem "puppetlabs_spec_helper", '~> 6.0', require: false -end puppet_version = ENV['PUPPET_GEM_VERSION'] facter_version = ENV['FACTER_GEM_VERSION'] diff --git a/metadata.json b/metadata.json index df225a9c04..d4acf80391 100644 --- a/metadata.json +++ b/metadata.json @@ -100,7 +100,7 @@ "version_requirement": ">= 7.0.0 < 9.0.0" } ], - "pdk-version": "3.0.0", + "pdk-version": "3.2.0", "template-url": "https://github.com/puppetlabs/pdk-templates#main", - "template-ref": "heads/main-0-g4fb29e7" + "template-ref": "tags/3.2.0.4-0-g5d17ec1" } diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 6820cebee7..ae7c1f6818 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -25,7 +25,8 @@ next unless File.exist?(f) && File.readable?(f) && File.size?(f) begin - default_facts.merge!(YAML.safe_load(File.read(f), permitted_classes: [], permitted_symbols: [], aliases: true)) + require 'deep_merge' + default_facts.deep_merge!(YAML.safe_load(File.read(f), permitted_classes: [], permitted_symbols: [], aliases: true)) rescue StandardError => e RSpec.configuration.reporter.message "WARNING: Unable to load #{f}: #{e}" end @@ -33,7 +34,7 @@ # read default_facts and merge them over what is provided by facterdb default_facts.each do |fact, value| - add_custom_fact fact, value + add_custom_fact fact, value, merge_facts: true end RSpec.configure do |c| From 076d76cb55650433c2cafc99d15d033b5750c951 Mon Sep 17 00:00:00 2001 From: Lucien Weller Date: Mon, 25 Nov 2024 07:34:16 +0100 Subject: [PATCH 54/69] added default version for fedora 40 and 41 --- manifests/globals.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/manifests/globals.pp b/manifests/globals.pp index b4a7bc290f..64a4815fcc 100644 --- a/manifests/globals.pp +++ b/manifests/globals.pp @@ -180,6 +180,7 @@ $default_version = $facts['os']['family'] ? { /^(RedHat|Linux)/ => $facts['os']['name'] ? { 'Fedora' => $facts['os']['release']['major'] ? { + /^(40|41)$/ => '16', /^(38|39)$/ => '15', /^(36|37)$/ => '14', /^(34|35)$/ => '13', From 553fc733ac4da65d391a02348aa90bce614377b6 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Mon, 25 Nov 2024 17:07:36 +0000 Subject: [PATCH 55/69] Release prep v10.4.0 --- CHANGELOG.md | 21 ++++++++++++++++++++- metadata.json | 2 +- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0f2ff5598..bb14a1289c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,25 @@ 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). +## [v10.4.0](https://github.com/puppetlabs/puppetlabs-postgresql/tree/v10.4.0) - 2024-11-25 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/v10.3.0...v10.4.0) + +### Added + +- added default version for fedora 40 and 41 [#1621](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1621) ([lweller](https://github.com/lweller)) +- (CAT-2124) Add support for Ubuntu 24 [#1619](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1619) ([skyamgarp](https://github.com/skyamgarp)) +- Add EL9 support [#1591](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1591) ([bastelfreak](https://github.com/bastelfreak)) + +### Fixed + +- Avoid opening the file in postgresql_conf [#1599](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1599) ([ekohl](https://github.com/ekohl)) + +### Other + +- Document how to select a version as its own chapter [#1610](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1610) ([ekohl](https://github.com/ekohl)) +- Fix typo in README: instaces -> instances [#1607](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1607) ([ekohl](https://github.com/ekohl)) + ## [v10.3.0](https://github.com/puppetlabs/puppetlabs-postgresql/tree/v10.3.0) - 2024-05-08 [Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/v10.2.0...v10.3.0) @@ -267,7 +286,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - add scram-sha-256 support [#1313](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1313) ([fe80](https://github.com/fe80)) - add support for Ubuntu Hirsute and Impish [#1312](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1312) ([nicholascioli](https://github.com/nicholascioli)) - Allow systemd to mask postgresql service file [#1310](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1310) ([kimsondrup](https://github.com/kimsondrup)) -- Make ::contrib a noop on OSes without a contrib package [#1309](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1309) ([carlosduelo](https://github.com/carlosduelo)) +- Make ::contrib a noop on OSes without a contrib package [#1309](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1309) ([cduelo](https://github.com/cduelo)) - pdksync - (IAC-1753) - Add Support for AlmaLinux 8 [#1308](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1308) ([david22swan](https://github.com/david22swan)) - MODULES-11201: add service_name for Ubuntu 18.04 and later [#1306](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1306) ([moritz-makandra](https://github.com/moritz-makandra)) - pdksync - (IAC-1751) - Add Support for Rocky 8 [#1305](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1305) ([david22swan](https://github.com/david22swan)) diff --git a/metadata.json b/metadata.json index d4acf80391..82f3c97482 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-postgresql", - "version": "10.3.0", + "version": "10.4.0", "author": "puppetlabs", "summary": "Offers support for basic management of PostgreSQL databases.", "license": "Apache-2.0", From ed8e752a0aee28285ee4273e0173be8025a8af2b Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Wed, 3 Jan 2024 12:05:14 -1000 Subject: [PATCH 56/69] [PATCH] reenable acceptance test for server encoding --- spec/acceptance/utf8_encoding_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/acceptance/utf8_encoding_spec.rb b/spec/acceptance/utf8_encoding_spec.rb index b816842138..a7c9b52497 100644 --- a/spec/acceptance/utf8_encoding_spec.rb +++ b/spec/acceptance/utf8_encoding_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper_acceptance' -describe 'postgresql::server', skip: 'IAC-1286' do +describe 'postgresql::server' do let(:pp) do <<-MANIFEST class { 'postgresql::globals': From 9f589ffd175ad416a314917136002bf81796bb8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Wed, 3 Jan 2024 12:06:16 -1000 Subject: [PATCH 57/69] Fix anchoring in `postgresql::server::plperl` When using anchors, resources should be sandwiched those. An ordering relation was missing for the "end" anchor. --- manifests/server/plperl.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/server/plperl.pp b/manifests/server/plperl.pp index 1db5d4aa8f..08c5298fc3 100644 --- a/manifests/server/plperl.pp +++ b/manifests/server/plperl.pp @@ -16,5 +16,5 @@ -> Class['postgresql::server::install'] -> Package['postgresql-plperl'] -> Class['postgresql::server::service'] - anchor { 'postgresql::server::plperl::end': } + -> anchor { 'postgresql::server::plperl::end': } } From f562902defda5afe8c121280c1b3fdd232ba3fa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Wed, 3 Jan 2024 12:10:08 -1000 Subject: [PATCH 58/69] Fix anchoring in `postgresql::server::instance::service` Some resources where not properly ordered between the "begin" and "end" anchors. Make sure they are properly bound to them. --- manifests/server/instance/service.pp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/manifests/server/instance/service.pp b/manifests/server/instance/service.pp index f778518dc0..47e7ecda25 100644 --- a/manifests/server/instance/service.pp +++ b/manifests/server/instance/service.pp @@ -42,6 +42,10 @@ status => $service_status, } + Anchor["postgresql::server::service::begin::${name}"] + -> Service["postgresqld_instance_${name}"] + -> Anchor["postgresql::server::service::end::${name}"] + if $service_ensure in ['running', true] { # This blocks the class before continuing if chained correctly, making # sure the service really is 'up' before continuing. @@ -56,10 +60,13 @@ sleep => 1, tries => 60, psql_path => $psql_path, - require => Service["postgresqld_instance_${name}"], - before => Anchor["postgresql::server::service::end::${name}"], } - Postgresql::Server::Database <| title == $default_database |> -> Postgresql_conn_validator["validate_service_is_running_instance_${name}"] + + Anchor["postgresql::server::service::begin::${name}"] + -> Service["postgresqld_instance_${name}"] + -> Postgresql::Server::Database <| title == $default_database |> + -> Postgresql_conn_validator["validate_service_is_running_instance_${name}"] + -> Anchor["postgresql::server::service::end::${name}"] } } From 62c5fc5b0cf07bf3aecd0e62e9ce479d7201c173 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Wed, 3 Jan 2024 12:19:55 -1000 Subject: [PATCH 59/69] Fix `postgresql_psql` autorequire It does not really make sense to require the "begin" anchor, the `postgresql_psql` type communicating with the server, it makes more sense to require the "end" anchor which mean that the server is running and reachable. --- lib/puppet/type/postgresql_psql.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/puppet/type/postgresql_psql.rb b/lib/puppet/type/postgresql_psql.rb index 021753e7ab..3b4a1c8353 100644 --- a/lib/puppet/type/postgresql_psql.rb +++ b/lib/puppet/type/postgresql_psql.rb @@ -135,7 +135,7 @@ def matches(value) end autorequire(:anchor) do - ["postgresql::server::service::begin::#{self[:instance]}"] + ["postgresql::server::service::end::#{self[:instance]}"] end autorequire(:service) do From cd67d139337851af33a817d3b724f98691f0cbb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Wed, 3 Jan 2024 13:05:46 -1000 Subject: [PATCH 60/69] Remove redundant autorequire We already have a relationship in `manifests/server/instance/service.pp` that ensure `Service["postgresqld_instance_${name}"]` is realized before `Anchor["postgresql::server::service::end::${name}"]`. Fun fact, removing this duplaciate fix the circular dependency reported by puppet. --- lib/puppet/type/postgresql_psql.rb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/puppet/type/postgresql_psql.rb b/lib/puppet/type/postgresql_psql.rb index 3b4a1c8353..d0101857c0 100644 --- a/lib/puppet/type/postgresql_psql.rb +++ b/lib/puppet/type/postgresql_psql.rb @@ -138,10 +138,6 @@ def matches(value) ["postgresql::server::service::end::#{self[:instance]}"] end - autorequire(:service) do - ["postgresqld_instance_#{self[:instance]}"] - end - def should_run_sql(refreshing = false) onlyif_param = @parameters[:onlyif] unless_param = @parameters[:unless] From 256971d469eb34e04e868ff4c09669de7638a0d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Wed, 17 Apr 2024 15:37:15 -1000 Subject: [PATCH 61/69] DELETE ME ss(8) report the same for a working and non-working port as far as serverspec is concerned. Maybe ordering has an impact? We know these tests fail when running at the end of the test suite, so attempt to run them earlier. --- spec/acceptance/{utf8_encoding_spec.rb => aaa_spec.rb} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename spec/acceptance/{utf8_encoding_spec.rb => aaa_spec.rb} (100%) diff --git a/spec/acceptance/utf8_encoding_spec.rb b/spec/acceptance/aaa_spec.rb similarity index 100% rename from spec/acceptance/utf8_encoding_spec.rb rename to spec/acceptance/aaa_spec.rb From d44c0d648ccaf681e9475b26e086cc6b42c1ad68 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 7 Jan 2025 09:55:48 +0100 Subject: [PATCH 62/69] puppetlabs/apt: allow 10.x --- metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index 82f3c97482..9c0589b726 100644 --- a/metadata.json +++ b/metadata.json @@ -14,7 +14,7 @@ }, { "name": "puppetlabs/apt", - "version_requirement": ">= 9.2.0 < 10.0.0" + "version_requirement": ">= 9.2.0 < 11.0.0" }, { "name": "puppet/systemd", From 0ce9c517b2a92bd9824945e800cc204721ba6ef1 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 7 Jan 2025 09:56:48 +0100 Subject: [PATCH 63/69] puppet/systemd: allow 8.x --- metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index 82f3c97482..05578913c0 100644 --- a/metadata.json +++ b/metadata.json @@ -18,7 +18,7 @@ }, { "name": "puppet/systemd", - "version_requirement": ">= 4.0.1 < 8.0.0" + "version_requirement": ">= 4.0.1 < 9.0.0" }, { "name": "puppetlabs/concat", From 8e17d7525d13e44d0fe7d305b4f7486102add97c Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 7 Jan 2025 09:55:48 +0100 Subject: [PATCH 64/69] puppetlabs/apt: allow 10.x --- metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index 05578913c0..106e4677a9 100644 --- a/metadata.json +++ b/metadata.json @@ -14,7 +14,7 @@ }, { "name": "puppetlabs/apt", - "version_requirement": ">= 9.2.0 < 10.0.0" + "version_requirement": ">= 9.2.0 < 11.0.0" }, { "name": "puppet/systemd", From 3f301f3d3e11f10fc3c2bb9bcd034e22a6d1a160 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 7 Jan 2025 09:56:48 +0100 Subject: [PATCH 65/69] puppet/systemd: allow 8.x --- metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index 9c0589b726..106e4677a9 100644 --- a/metadata.json +++ b/metadata.json @@ -18,7 +18,7 @@ }, { "name": "puppet/systemd", - "version_requirement": ">= 4.0.1 < 8.0.0" + "version_requirement": ">= 4.0.1 < 9.0.0" }, { "name": "puppetlabs/concat", From 5c9c61f913643cd479d05ff239a7e83d480c899c Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Tue, 7 Jan 2025 10:25:32 +0000 Subject: [PATCH 66/69] Release prep v10.5.0 --- CHANGELOG.md | 11 ++++++++++- metadata.json | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb14a1289c..e28d5a2f94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,16 @@ 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). -## [v10.4.0](https://github.com/puppetlabs/puppetlabs-postgresql/tree/v10.4.0) - 2024-11-25 +## [v10.5.0](https://github.com/puppetlabs/puppetlabs-postgresql/tree/v10.5.0) - 2025-01-07 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/v10.4.0...v10.5.0) + +### Added + +- puppet/systemd: allow 8.x [#1627](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1627) ([evgeni](https://github.com/evgeni)) +- puppetlabs/apt: allow 10.x [#1626](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1626) ([evgeni](https://github.com/evgeni)) + +## [v10.4.0](https://github.com/puppetlabs/puppetlabs-postgresql/tree/v10.4.0) - 2024-12-16 [Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/v10.3.0...v10.4.0) diff --git a/metadata.json b/metadata.json index 106e4677a9..6ad73624ec 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-postgresql", - "version": "10.4.0", + "version": "10.5.0", "author": "puppetlabs", "summary": "Offers support for basic management of PostgreSQL databases.", "license": "Apache-2.0", From 95922a8d7a28da009e13373ec51af31bdb7671ea Mon Sep 17 00:00:00 2001 From: Andrew Moore Date: Wed, 18 Dec 2024 15:53:22 +0000 Subject: [PATCH 67/69] Role Valid Until Date This allows for the valid until attribute to be set on roles. --- manifests/server/role.pp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/manifests/server/role.pp b/manifests/server/role.pp index 1b37ce282c..6103c19ac2 100644 --- a/manifests/server/role.pp +++ b/manifests/server/role.pp @@ -35,6 +35,7 @@ Boolean $inherit = true, Boolean $superuser = false, Boolean $replication = false, + Optional[String[1]] $valid_until = undef, String[1] $connection_limit = '-1', String[1] $username = $title, Hash $connect_settings = $postgresql::server::default_connect_settings, @@ -126,6 +127,12 @@ unless => "SELECT 1 FROM pg_roles WHERE rolname = '${username}' AND rolinherit = ${inherit}", } + if $valid_until { + postgresql_psql { "ALTER ROLE \"${username}\" VALID UNTIL '${valid_until}'": + unless => "SELECT 1 FROM pg_roles WHERE rolname = '${username}' AND rolvaliduntil = '${valid_until}'", + } + } + if(versioncmp($version, '9.1') >= 0) { if $replication_sql == '' { postgresql_psql { "ALTER ROLE \"${username}\" NOREPLICATION": From c16d85059fea735fce8769ee4f1059a5785c7f29 Mon Sep 17 00:00:00 2001 From: Andrew Moore Date: Tue, 7 Jan 2025 09:45:18 +0000 Subject: [PATCH 68/69] Role valid_until documentation and tests --- manifests/server/role.pp | 1 + spec/defines/server_instance_spec.rb | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/manifests/server/role.pp b/manifests/server/role.pp index 6103c19ac2..f71ecf599c 100644 --- a/manifests/server/role.pp +++ b/manifests/server/role.pp @@ -11,6 +11,7 @@ # @param inherit Specifies whether to grant inherit capability for the new role. # @param superuser Specifies whether to grant super user capability for the new role. # @param replication Provides provides replication capabilities for this role if set to true. +# @param valid_until Specifies whether to set a valid until date for the role. # @param connection_limit Specifies how many concurrent connections the role can make. Default value: '-1', meaning no limit. # @param username Defines the username of the role to create. # @param connect_settings Specifies a hash of environment variables used when connecting to a remote server. diff --git a/spec/defines/server_instance_spec.rb b/spec/defines/server_instance_spec.rb index 89eadb06c8..ea63146fe4 100644 --- a/spec/defines/server_instance_spec.rb +++ b/spec/defines/server_instance_spec.rb @@ -73,7 +73,9 @@ class { 'postgresql::server': 'app_test1': { 'login' => true }, 'rep_test1': { 'replication' => true, 'login' => true }, - 'rou_test1': { 'login' => true }, }, + 'rou_test1': { 'login' => true }, + 'val_test1': { 'login' => true, + 'valid_until' => '2030-01-01 00:00:00+00' }, }, 'pg_hba_rules': { 'local all INSTANCE user': { 'type' => 'local', 'database' => 'all', 'user' => 'ins_test1', @@ -214,10 +216,19 @@ class { 'postgresql::server': it { is_expected.to contain_postgresql_psql('ALTER ROLE "rou_test1" NOCREATEROLE') } it { is_expected.to contain_postgresql_psql('ALTER ROLE "rou_test1" NOREPLICATION') } it { is_expected.to contain_postgresql_psql('ALTER ROLE "rou_test1" NOSUPERUSER') } + it { is_expected.to contain_postgresql_psql('ALTER ROLE "val_test1" CONNECTION LIMIT -1') } + it { is_expected.to contain_postgresql_psql('ALTER ROLE "val_test1" INHERIT') } + it { is_expected.to contain_postgresql_psql('ALTER ROLE "val_test1" LOGIN') } + it { is_expected.to contain_postgresql_psql('ALTER ROLE "val_test1" NOCREATEDB') } + it { is_expected.to contain_postgresql_psql('ALTER ROLE "val_test1" NOCREATEROLE') } + it { is_expected.to contain_postgresql_psql('ALTER ROLE "val_test1" NOREPLICATION') } + it { is_expected.to contain_postgresql_psql('ALTER ROLE "val_test1" NOSUPERUSER') } + it { is_expected.to contain_postgresql_psql('ALTER ROLE "val_test1" VALID UNTIL \'2030-01-01 00:00:00+00\'') } it { is_expected.to contain_postgresql_psql('CREATE ROLE app_test1 ENCRYPTED PASSWORD ****') } it { is_expected.to contain_postgresql_psql('CREATE ROLE dba_test1 ENCRYPTED PASSWORD ****') } it { is_expected.to contain_postgresql_psql('CREATE ROLE ins_test1 ENCRYPTED PASSWORD ****') } it { is_expected.to contain_postgresql_psql('CREATE ROLE rep_test1 ENCRYPTED PASSWORD ****') } it { is_expected.to contain_postgresql_psql('CREATE ROLE rou_test1 ENCRYPTED PASSWORD ****') } + it { is_expected.to contain_postgresql_psql('CREATE ROLE val_test1 ENCRYPTED PASSWORD ****') } end end From 6346da7be1986afcc5cebe79012bf664c80258c2 Mon Sep 17 00:00:00 2001 From: Shubham Shinde Date: Tue, 22 Apr 2025 12:37:56 +0530 Subject: [PATCH 69/69] (CAT-2296) Update github runner image to ubuntu-24.04 ubuntu-20.04 is not supported anymore: https://github.com/actions/runner-images/issues/11101 --- .github/workflows/ci.yml | 4 ++-- .github/workflows/nightly.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e6dd8d7bc0..93cd3406b7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,12 +10,12 @@ jobs: Spec: uses: "puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main" with: - runs_on: "ubuntu-20.04" + runs_on: "ubuntu-24.04" secrets: "inherit" Acceptance: needs: Spec uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main" with: - runs_on: "ubuntu-20.04" + runs_on: "ubuntu-24.04" secrets: "inherit" diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index b8786059ec..c6539f7e37 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -9,12 +9,12 @@ jobs: Spec: uses: "puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main" with: - runs_on: "ubuntu-20.04" + runs_on: "ubuntu-24.04" secrets: "inherit" Acceptance: needs: Spec uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main" with: - runs_on: "ubuntu-20.04" + runs_on: "ubuntu-24.04" secrets: "inherit" pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy