puppetlabs-postgresql icon indicating copy to clipboard operation
puppetlabs-postgresql copied to clipboard

Only require password when used

Open arjenz opened this issue 3 years ago • 6 comments

If the if in line 39 evaluates to false, the user has been created elsewhere, and we don't actually use (and thus need) password in postgresql::server::db class.

arjenz avatar Aug 09 '22 10:08 arjenz

postgresql::server::db is a type

Breaking changes to this file WILL impact these 37 modules (exact match):
Breaking changes to this file MAY impact these 20 modules (near match):

This module is declared in 70 of 579 indexed public Puppetfiles.


These results were generated with Rangefinder, a tool that helps predict the downstream impact of breaking changes to elements used in Puppet modules. You can run this on the command line to get a full report.

Exact matches are those that we can positively identify via namespace and the declaring modules' metadata. Non-namespaced items, such as Puppet 3.x functions, will always be reported as near matches only.

Well the major use case from my end is "this is how we happen to use it, and it stopped working when https://github.com/puppetlabs/puppetlabs-postgresql/commit/d878d13f030cdd872cbb04c43ad0f065fec0b923#diff-09acae987abfb6f2de2796ebbbcee8911d8326cf762451972538f4f78984f35c was introduced". Before that commit setting it to undef was fine, but afterwards not anymore. Looking just at the code in this class, without taking global context into perspective this solution kind of makes sense. "Why require data when it's not actually used or needed for this class".

arjenz avatar Aug 09 '22 10:08 arjenz

Oh, and right now, as a workaround, we're passing around password: 'unused' in hiera, since the value gets ignored anyway, so I feel solving this in the code is a bit more elegant :)

arjenz avatar Aug 09 '22 10:08 arjenz

Done :)

arjenz avatar Aug 09 '22 12:08 arjenz

Did you forget to push?

ekohl avatar Aug 09 '22 13:08 ekohl

Did you forget to push?

Yes, yes I did :)

arjenz avatar Aug 09 '22 14:08 arjenz