Description
Describe the Bug
When the module is used with Puppet 7 clients, catalog compilation fails unless parameter postgresql::globals::service_provider
is explicitly set in Hiera data or a resource-like class declaration.
This is a regression: the module used to choose a suitable provider without help.
Expected Behavior
The module should choose the target system's default service provider automatically. The manifest set and site data should not need to specify one explicitly unless something different from the default is required.
Steps to Reproduce
Steps to reproduce the behavior:
- Install puppetlabs-postgresql 9.2.0
- Attempt to compile a catalog containing this declaration:
with facts from a Puppet 7 client.
include postgresql::server
Catalog compilation then fails with an error such as this spec test output shows:
1) demo on redhat-8-x86_64 is expected to compile into a catalogue without dependency cycles
Failure/Error: it { is_expected.to compile.with_all_deps }
error during compilation: Evaluation Error: Error while evaluating a Function Call, pick(): must receive at least one non empty value (file: /.../environments/production/modules/demo/spec/fixtures/modules/postgresql/manifests/params.pp, line: 88, column: 10) on node x.y.z
# ./spec/classes/demo_spec.rb:10:in `block (4 levels) in <top (required)>'
Environment
- Puppet 7.26.0
- puppetlabs-posgresql 9.2.0
- RHEL 7 server, RHEL 7-8, CentOS 7-8, Rocky 8-9 clients
Additional Context
The module seems to be trying to use $facts['service_provider']
to identify the default provider, but this fact is not served by the version of facter bundled with Puppet 7.
The issue can be worked around by providing a suitable value for class parameter postgresql::globals::service_provider
.