Skip to content

add loop through grant_role type to allow predefined roles to be used in existing databases#1673

Draft
ikonia wants to merge 3 commits into
puppetlabs:mainfrom
ikonia:grant_loop
Draft

add loop through grant_role type to allow predefined roles to be used in existing databases#1673
ikonia wants to merge 3 commits into
puppetlabs:mainfrom
ikonia:grant_loop

Conversation

@ikonia
Copy link
Copy Markdown
Contributor

@ikonia ikonia commented May 27, 2026

Summary

previous MR's have added parameters, roles to align to the role type, grants to allow to the grant type and databases to align to the database type, which allow the creation of resources from values within hiera.

This additional loop following the same pattern as the other approved MR's loops through grant_roles to the grant_role type, which allow the use of pre-defined roles within Postgres such as https://www.postgresql.org/docs/current/predefined-roles.html which cannot be set with the grant type alone.

Additional Context

Add any additional context about the problem here.

  • Root cause and the steps to reproduce. (If applicable)
  • Thought process behind the implementation.

Following existing working patterns to extend the functionality of the module in a least complex way

Related Issues (if any)

Mention any related issues or pull requests.

Checklist

  • [ x] 🟢 Spec tests.
  • [x ] 🟢 Acceptance tests.
  • [x ] Manually verified. (For example puppet apply)

no changes needed to the spec, acceptance tests not required I believe based on the other MR's of this type. Tested against pre-defined roles.

@ikonia ikonia marked this pull request as draft May 27, 2026 19:21
@ikonia
Copy link
Copy Markdown
Contributor Author

ikonia commented May 27, 2026

would appreciate a review on approach on this, especially the database creation fix for if the database doesn't exist before the extension is applied

@ikonia ikonia marked this pull request as ready for review May 27, 2026 21:04
@ikonia
Copy link
Copy Markdown
Contributor Author

ikonia commented May 28, 2026

I see my change to fix the dependency cycle removing Class['postgresql::server'] -> Postgresql_psql["grant_role:${name}"] that looked obsolete because it appeared to never be called from outside the class has broke a test suit. I'll look into if this test is actually still valid (I suspect it is and I'll need to change this PR) or if it's orphaned from an earlier version of the module

@ikonia ikonia marked this pull request as draft May 28, 2026 06:07
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.

1 participant