puppetlabs / puppetlabs/puppetlabs-postgresql

Managing postgresql::server::role fails when using non-default port

Open
#1,554 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the Bug

Before #1498, only one configuration key was needed to manage both postgresql::server and postgresql::server::role: postgresql::server::port.

Since the PR, if only the first key is set, Puppet will fail to create the role claiming it can't connect to port 5432.
We are now forced to set 2 configuration keys when we want to start postgresql server on a custom TCP port:

---
postgresql::server::port: 5433
postgresql::globals::default_connect_settings:
  "PGPORT": "5433"

Expected Behavior

One key to manage tcp port for both server and managed resources (role, extension, ...).

Steps to Reproduce

Steps to reproduce the behavior:

  1. Set postgresql::server with a custom port (eg 5433)
  2. Set postgresql::server::role
  3. Do a puppet run and see postgresql::server::role failing

Environment

  • puppetlabs-postgresql 10.0.2
  • Platform - RHEL9/Postgresql 16

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 reproducing the Puppet run with postgresql::server::port set to 5433 and postgresql::server::role managed without PGPORT. Trace how the server port and default_connect_settings reach the role connection. Done means the role and other managed resources use the configured custom port without requiring a second setting.

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
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.