Skip to content

#1639 - fix - unless check in postgresql::server::instance::passwd do… #1640

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

asusk7m550
Copy link

Summary

This pull request updates the unless check in the postgresql::server::instance::passwd define to include the ${_dboption} variable. This ensures that the unless command connects to the correct database, especially when the database name differs from the user name. Previously, the unless check always connected to the default database (matching the user), which could cause the password check to run against the wrong database and result in unnecessary or skipped password changes.

Additional Context

  • Root cause and steps to reproduce:
    The root cause was that the unless command did not include the --dbname option when the database name was different from the user name.
    Steps to reproduce:
    1. Set up a PostgreSQL instance where the database name is different from the user name.
    2. Apply the Puppet manifest to set the postgres password.
    3. Observe that the password check may not work as intended, causing the password to be reset unnecessarily or not at all.
  • Thought process behind the implementation:
    The fix reuses the existing ${_dboption} logic, which is already used in the main password change command, to ensure both commands operate on the intended database. This improves consistency and reliability for environments where the database and user names differ.

Related Issues

Fixes: #1639
Related: -

Checklist

  • Manually verified. (For example puppet apply)

…:passwd does not respect custom database name (missing --dbname option)
@CLAassistant
Copy link

CLAassistant commented Jun 12, 2025

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

unless check in postgresql::server::instance::passwd does not respect custom database name (missing --dbname option)
2 participants