#1639 - fix - unless check in postgresql::server::instance::passwd do… #1640
+1
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This pull request updates the
unless
check in thepostgresql::server::instance::passwd
define to include the${_dboption}
variable. This ensures that theunless
command connects to the correct database, especially when the database name differs from the user name. Previously, theunless
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
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:
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
puppet apply
)