puppetlabs / puppetlabs/puppetlabs-postgresql

postgresql::server::grant does not honor connect_settings

Open
#1,329 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bugfix community
Dominant language
Ruby
Stars
232
Forks
610
Avg merge
5d 23h
Merged PRs (30d)
4

Description

Describe the Bug

I am using the postgresql::server::grant type to manage an external PostgreSQL server that is not managed with postgresql::server. When I use grant_role, I use the connect_settings parameter, and it works. When I do the same with grant, I get the following:

Mar  9 13:58:49 phoebe2 puppet-agent[1748481]: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Postgresql::Server::Grant[SELECT ON SCHEMA brs TO brs]:
Mar  9 13:58:49 phoebe2 puppet-agent[1748481]:   parameter 'psql_db' expects a String value, got Undef
Mar  9 13:58:49 phoebe2 puppet-agent[1748481]:   parameter 'psql_user' expects a String value, got Undef
Mar  9 13:58:49 phoebe2 puppet-agent[1748481]:   parameter 'port' expects an Integer value, got Undef
Mar  9 13:58:49 phoebe2 puppet-agent[1748481]:   parameter 'group' expects a String value, got Undef
Mar  9 13:58:49 phoebe2 puppet-agent[1748481]:   parameter 'psql_path' expects a String value, got Undef (file: /etc/puppetlabs/code/environments/production/manifests/site.pp, line: 215) on node phoebe2.rac.berkeley.edu

Expected Behavior

I expect that by setting connect_settings, I won't need to set psql_db, psql_user, port, group, and psql_path separately.

Steps to Reproduce

  1. Set up a connect_settings hash.
  2. Create a task that uses the connect_settings without the other parameters.

Environment

  • Version 8.0.0
  • Platform Ubuntu 20.04.4, Postgresql 13.2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing how postgresql::server::grant_role and postgresql::server::grant handle the connect_settings parameter. Reproduce the issue with connect_settings while leaving psql_db, psql_user, port, group, and psql_path unset. Done means grant uses the connection settings without requiring those parameters separately.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql, ruby
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.