Skip to content

Adding support for certificate authentication + adding support for specifying tags - #105

Open
hbro wants to merge 7 commits into
voxpupuli:mainfrom
hbro:main
Open

hbro wants to merge 7 commits into
voxpupuli:mainfrom
hbro:main

Conversation

@hbro

@hbro hbro commented Feb 3, 2026

Copy link
Copy Markdown

Pull Request (PR) description

This is basically a rebase of PR #33 with Maarten's IRL approval. I have had this running in production for 3 years now on top of our local mirror. The rebase should make merging easier.

I also see there are more recent PR's for adding tags support. Not sure if mine has preference or not. Or I can split up the commits into two PR's. Just let me know.

This Pull Request (PR) fixes the following issues

  • Missing cert auth config
  • Missing tags config

@bastelfreak bastelfreak added the enhancement New feature or request label Feb 3, 2026
Comment thread manifests/init.pp Outdated
# PostgreSQL Settings
String $superuser_username = 'postgres',
String $superuser_password = 'changeme',
Optional[String] $superuser_password = 'changeme',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the default value isn't undef, the Optional type doesn't make sense.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modified to set the default to undef then, because when I configure cert auth, I don't want to also accidentally enable password auth with a default dummy password.

Alternatively, I could add some if/else logic that checks if any of the cert auth parameters are set and if so, never set the superuser_password in the conf file?

Comment thread manifests/init.pp Outdated
Comment on lines +340 to +344
Optional[String] $superuser_sslmode = undef,
Optional[String] $superuser_sslkey = undef,
Optional[String] $superuser_sslpassword = undef,
Optional[String] $superuser_sslcert = undef,
Optional[String] $superuser_sslrootcert = undef,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to allow empty strings as valid values? Otherwise you can enforce the string length by using Optional[String[1]]. For the paths, you can use the Stdlib::Absolutepath type, and for sslmode probably an enum?

Comment thread templates/postgresql.yml.erb Outdated
superuser:
username: <%= @superuser_username %>
password: '<%= @superuser_password %>'
<% if @superuser_password != nil -%>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can simplify the check with

Suggested change
<% if @superuser_password != nil -%>
<% if @superuser_password -%>

@bastelfreak

Copy link
Copy Markdown
Member

thanks for the PR. please also run bundle exec rake strings:generate:reference to regenerate the REFERENCE.md.

@hbro

hbro commented Feb 3, 2026

Copy link
Copy Markdown
Author

Trying to set up some local testing to see why the config isn't validating, but I'm digging myself another rabbit hole. And missing half of CfgMgmtCamp ;-)

Will look into it later.

@hbro

hbro commented Feb 3, 2026

Copy link
Copy Markdown
Author

Don't have a test for the tags yet, should I also include that in this PR?

EDIT: Nvm, I did, since I needed to fix the quoted password regression anyway.

@hbro

hbro commented Feb 10, 2026

Copy link
Copy Markdown
Author

Is this acceptable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants