Skip to content

Commit 178c6b6

Browse files
authored
Merge branch 'puppetlabs:main' into main
2 parents 3f54813 + 45ddf36 commit 178c6b6

File tree

31 files changed

+191
-141
lines changed

31 files changed

+191
-141
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,4 @@ jobs:
1616
Acceptance:
1717
needs: Spec
1818
uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main"
19-
with:
20-
runs_on: "ubuntu-24.04"
2119
secrets: "inherit"

.github/workflows/nightly.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,4 @@ jobs:
1515
Acceptance:
1616
needs: Spec
1717
uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main"
18-
with:
19-
runs_on: "ubuntu-24.04"
2018
secrets: "inherit"

.puppet-lint.rc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
--fail-on-warnings
12
--relative
3+
--no-80chars-check
4+
--no-140chars-check
5+
--no-class_inherits_from_params_class-check
6+
--no-autoloader_layout-check
7+
--no-documentation-check
8+
--no-single_quote_string_with_variables-check
9+
--ignore-paths=.vendor/**/*.pp,.bundle/**/*.pp,pkg/**/*.pp,spec/**/*.pp,tests/**/*.pp,types/**/*.pp,vendor/**/*.pp
210
--no-anchor_resource-check
311
--no-params_empty_string_assignment-check

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ require:
55
AllCops:
66
NewCops: enable
77
DisplayCopNames: true
8-
TargetRubyVersion: '2.6'
8+
TargetRubyVersion: 3.1
99
Include:
1010
- "**/*.rb"
1111
Exclude:

CHANGELOG.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,34 @@ All notable changes to this project will be documented in this file.
55

66
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).
77

8+
## [v10.6.1](https://github.com/puppetlabs/puppetlabs-postgresql/tree/v10.6.1) - 2025-12-26
9+
10+
[Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/v10.6.0...v10.6.1)
11+
12+
### Fixed
13+
14+
- Replace systemctl `status` with systemctl `is-active` [#1652](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1652) ([bastelfreak](https://github.com/bastelfreak))
15+
- Don't use type alias in `postgresql_password` parameter [#1611](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1611) ([figless](https://github.com/figless))
16+
17+
## [v10.6.0](https://github.com/puppetlabs/puppetlabs-postgresql/tree/v10.6.0) - 2025-10-13
18+
19+
[Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/v10.5.0...v10.6.0)
20+
21+
### Added
22+
23+
- Allow puppetlabs/apt 11.x & puppet/systemd 9.x [#1645](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1645) ([kenyon](https://github.com/kenyon))
24+
- Add support for Debian 13 (trixie) [#1638](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1638) ([trefzer](https://github.com/trefzer))
25+
- Role: Add support for valid_until [#1624](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1624) ([mooreandrew](https://github.com/mooreandrew))
26+
27+
### Fixed
28+
29+
- Debian 11: Use correct package name for python bindings [#1647](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1647) ([bastelfreak](https://github.com/bastelfreak))
30+
- Unbreak Debian support with custom encoding [#1564](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1564) ([smortex](https://github.com/smortex))
31+
32+
### Other
33+
34+
- (CAT-2296) Update github runner image to ubuntu-24.04 [#1636](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1636) ([shubhamshinde360](https://github.com/shubhamshinde360))
35+
836
## [v10.5.0](https://github.com/puppetlabs/puppetlabs-postgresql/tree/v10.5.0) - 2025-01-07
937

1038
[Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/v10.4.0...v10.5.0)
@@ -352,7 +380,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
352380

353381
### Fixed
354382

355-
- Do not add version component to repo definition [#1282](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1282) ([weastur](https://github.com/weastur))
383+
- Do not add version component to repo definition [#1282](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1282) ([psapezhka](https://github.com/psapezhka))
356384
- (MODULES-8700) Autorequire the service in postgresql_psql [#1276](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1276) ([ekohl](https://github.com/ekohl))
357385

358386
## [v7.2.0](https://github.com/puppetlabs/puppetlabs-postgresql/tree/v7.2.0) - 2021-05-24

Gemfile

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@ def location_for(place_or_version, fake_version = nil)
1414
end
1515

1616
group :development do
17-
gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
18-
gem "json", '= 2.3.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
19-
gem "json", '= 2.5.1', require: false if Gem::Requirement.create(['>= 3.0.0', '< 3.0.5']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
2017
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))
2118
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))
2219
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))
2320
gem "deep_merge", '~> 1.2.2', require: false
2421
gem "voxpupuli-puppet-lint-plugins", '~> 5.0', require: false
25-
gem "facterdb", '~> 1.18', require: false
22+
gem "facterdb", '~> 2.1', require: false if Gem::Requirement.create(['< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
23+
gem "facterdb", '~> 3.0', require: false if Gem::Requirement.create(['>= 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
2624
gem "metadata-json-lint", '~> 4.0', require: false
27-
gem "rspec-puppet-facts", '~> 2.0', require: false
25+
gem "json-schema", '< 5.1.1', require: false
26+
gem "rspec-puppet-facts", '~> 4.0', require: false if Gem::Requirement.create(['< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
27+
gem "rspec-puppet-facts", '~> 5.0', require: false if Gem::Requirement.create(['>= 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
2828
gem "dependency_checker", '~> 1.0.0', require: false
2929
gem "parallel_tests", '= 3.12.1', require: false
3030
gem "pry", '~> 0.10', require: false
3131
gem "simplecov-console", '~> 0.9', require: false
32-
gem "puppet-debugger", '~> 1.0', require: false
32+
gem "puppet-debugger", '~> 1.6', require: false
3333
gem "rubocop", '~> 1.50.0', require: false
3434
gem "rubocop-performance", '= 1.16.0', require: false
3535
gem "rubocop-rspec", '= 2.19.0', require: false
@@ -38,26 +38,32 @@ group :development do
3838
end
3939
group :development, :release_prep do
4040
gem "puppet-strings", '~> 4.0', require: false
41-
gem "puppetlabs_spec_helper", '~> 7.0', require: false
41+
gem "puppetlabs_spec_helper", '~> 8.0', require: false
42+
gem "puppet-blacksmith", '~> 7.0', require: false
4243
end
4344
group :system_tests do
44-
gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw]
45+
gem "puppet_litmus", '~> 2.0', require: false, platforms: [:ruby, :x64_mingw] if !ENV['PUPPET_FORGE_TOKEN'].to_s.empty?
46+
gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw] if ENV['PUPPET_FORGE_TOKEN'].to_s.empty?
4547
gem "CFPropertyList", '< 3.0.7', require: false, platforms: [:mswin, :mingw, :x64_mingw]
4648
gem "serverspec", '~> 2.41', require: false
4749
end
4850

49-
puppet_version = ENV['PUPPET_GEM_VERSION']
50-
facter_version = ENV['FACTER_GEM_VERSION']
51-
hiera_version = ENV['HIERA_GEM_VERSION']
5251

5352
gems = {}
53+
puppet_version = ENV.fetch('PUPPET_GEM_VERSION', nil)
54+
facter_version = ENV.fetch('FACTER_GEM_VERSION', nil)
55+
hiera_version = ENV.fetch('HIERA_GEM_VERSION', nil)
5456

55-
gems['puppet'] = location_for(puppet_version)
56-
57-
# If facter or hiera versions have been specified via the environment
58-
# variables
57+
# If PUPPET_FORGE_TOKEN is set then use authenticated source for both puppet and facter, since facter is a transitive dependency of puppet
58+
# Otherwise, do as before and use location_for to fetch gems from the default source
59+
if !ENV['PUPPET_FORGE_TOKEN'].to_s.empty?
60+
gems['puppet'] = ['~> 8.11', { require: false, source: 'https://rubygems-puppetcore.puppet.com' }]
61+
gems['facter'] = ['~> 4.11', { require: false, source: 'https://rubygems-puppetcore.puppet.com' }]
62+
else
63+
gems['puppet'] = location_for(puppet_version)
64+
gems['facter'] = location_for(facter_version) if facter_version
65+
end
5966

60-
gems['facter'] = location_for(facter_version) if facter_version
6167
gems['hiera'] = location_for(hiera_version) if hiera_version
6268

6369
gems.each do |gem_name, gem_params|

REFERENCE.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,7 +1006,7 @@ Default value: `$postgresql::params::service_reload`
10061006

10071007
##### <a name="-postgresql--server--service_status"></a>`service_status`
10081008

1009-
Data type: `Optional[String[1]]`
1009+
Data type: `Optional[Variant[Array[String[1]],String[1]]]`
10101010

10111011
Overrides the default status check command for your PostgreSQL service.
10121012

@@ -3677,6 +3677,7 @@ The following parameters are available in the `postgresql::server::role` defined
36773677
* [`inherit`](#-postgresql--server--role--inherit)
36783678
* [`superuser`](#-postgresql--server--role--superuser)
36793679
* [`replication`](#-postgresql--server--role--replication)
3680+
* [`valid_until`](#-postgresql--server--role--valid_until)
36803681
* [`connection_limit`](#-postgresql--server--role--connection_limit)
36813682
* [`username`](#-postgresql--server--role--username)
36823683
* [`connect_settings`](#-postgresql--server--role--connect_settings)
@@ -3769,6 +3770,14 @@ Provides provides replication capabilities for this role if set to true.
37693770

37703771
Default value: `false`
37713772

3773+
##### <a name="-postgresql--server--role--valid_until"></a>`valid_until`
3774+
3775+
Data type: `Optional[String[1]]`
3776+
3777+
Specifies whether to set a valid until date for the role.
3778+
3779+
Default value: `undef`
3780+
37723781
##### <a name="-postgresql--server--role--connection_limit"></a>`connection_limit`
37733782

37743783
Data type: `String[1]`
@@ -4733,7 +4742,7 @@ Type: Ruby 4.x API
47334742

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

4736-
#### `postgresql::postgresql_password(Variant[String[1], Integer] $username, Variant[String[1], Sensitive[String[1]], Integer] $password, Optional[Boolean] $sensitive, Optional[Optional[Postgresql::Pg_password_encryption]] $hash, Optional[Optional[Variant[String[1], Integer]]] $salt)`
4745+
#### `postgresql::postgresql_password(Variant[String[1], Integer] $username, Variant[String[1], Sensitive[String[1]], Integer] $password, Optional[Boolean] $sensitive, Optional[Optional[Enum["md5", "scram-sha-256"]]] $hash, Optional[Optional[Variant[String[1], Integer]]] $salt)`
47374746

47384747
The postgresql::postgresql_password function.
47394748

@@ -4759,7 +4768,7 @@ If the Postgresql-Passwordhash should be of Datatype Sensitive[String]
47594768

47604769
##### `hash`
47614770

4762-
Data type: `Optional[Optional[Postgresql::Pg_password_encryption]]`
4771+
Data type: `Optional[Optional[Enum["md5", "scram-sha-256"]]]`
47634772

47644773
Set type for password hash
47654774

@@ -4880,7 +4889,8 @@ Alias of `Hash[String[1], Postgresql::Pg_hba_rule]`
48804889

48814890
### <a name="Postgresql--Pg_password_encryption"></a>`Postgresql::Pg_password_encryption`
48824891

4883-
the supported password_encryption
4892+
Note that this Enum is also defined in:
4893+
lib/puppet/functions/postgresql/postgresql_password.rb
48844894

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

Rakefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,11 @@ require 'puppet-strings/tasks' if Gem.loaded_specs.key? 'puppet-strings'
99
PuppetLint.configuration.send('disable_relative')
1010
PuppetLint.configuration.send('disable_anchor_resource')
1111
PuppetLint.configuration.send('disable_params_empty_string_assignment')
12+
PuppetLint.configuration.send('disable_80chars')
13+
PuppetLint.configuration.send('disable_140chars')
14+
PuppetLint.configuration.send('disable_class_inherits_from_params_class')
15+
PuppetLint.configuration.send('disable_autoloader_layout')
16+
PuppetLint.configuration.send('disable_documentation')
17+
PuppetLint.configuration.send('disable_single_quote_string_with_variables')
18+
PuppetLint.configuration.fail_on_warnings = true
19+
PuppetLint.configuration.ignore_paths = [".vendor/**/*.pp", ".bundle/**/*.pp", "pkg/**/*.pp", "spec/**/*.pp", "tests/**/*.pp", "types/**/*.pp", "vendor/**/*.pp"]

lib/puppet/functions/postgresql/postgresql_password.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
required_param 'Variant[String[1], Integer]', :username
2525
required_param 'Variant[String[1], Sensitive[String[1]], Integer]', :password
2626
optional_param 'Boolean', :sensitive
27-
optional_param 'Optional[Postgresql::Pg_password_encryption]', :hash
27+
# The following Enum is also defined in `types/pg_password_encryption.pp` but type alias can't be used in Deferred functions.
28+
optional_param 'Optional[Enum["md5", "scram-sha-256"]]', :hash
2829
optional_param 'Optional[Variant[String[1], Integer]]', :salt
2930
return_type 'Variant[String, Sensitive[String]]'
3031
end
@@ -65,7 +66,7 @@ def pg_sha256(password, salt)
6566
def digest_key(password, salt)
6667
OpenSSL::KDF.pbkdf2_hmac(
6768
password,
68-
salt: salt,
69+
salt:,
6970
iterations: 4096,
7071
length: 32,
7172
hash: OpenSSL::Digest.new('SHA256'),

lib/puppet/provider/postgresql_conf/ruby.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def parse_config
2929
else
3030
matches[:value].delete("'")
3131
end
32-
attributes_hash = { line_number: line_number, key: matches[:key], ensure: 'present', value: value, comment: matches[:comment] }
32+
attributes_hash = { line_number:, key: matches[:key], ensure: 'present', value:, comment: matches[:comment] }
3333
active_settings.push(attributes_hash)
3434
end
3535
end
@@ -80,7 +80,7 @@ def exists?
8080

8181
# remove resource if exists and is set to absent
8282
def destroy
83-
entry_regex = %r{#{resource[:key]}.*=.*#{resource[:value]}}
83+
entry_regex = %r{^\s*#{resource[:key]}\s*=}
8484
lines = File.readlines(resource[:target])
8585

8686
lines.delete_if do |entry|

0 commit comments

Comments
 (0)