Reuse the existing PostgreSQL resources for Patroni bootstrap
What does this MR do?
Database objects, including roles, extensions, and functions, are factored out from postgresql::enable
into postgresql::database_objects
recipedatabase_objects
custom resource (located in gitlab
cookbook). This new recipe resource is used by both postgresql::enable
and patroni::enable
recipes. In order to do so, the resources are generalized and guarded to work with both standalone PostgreSQL and Patroni. As a result, Patroni's post-bootstrap script is made redundant and was eliminated.
Related issues
Closes #5419 (closed)
Checklist
See Definition of done.
-
Changelog entry created. Not applicable for Documentation changes and minor changes. -
Documentation created/updated -
Tests added -
Integration tests added to GitLab QA, if applicable -
MR targeting master
branch -
MR has a green pipeline on GitLab.com -
Equivalent MR/issue for CNG opened if applicable -
trigger-package
has a green pipeline running against latest commit
Tests
-
Single-node Patroni with no replicas -
Conversion of a standalone PostgreSQL to Patroni -
Multi-node Patroni with multiple replicas -
Conversion of a multi-node repmgr cluster to Patroni
Reviewer Checklist
In addition to above, reviewer must:
-
Pipeline is green on dev.gitlab.org if the change is not touching documentation or internal cookbooks
Edited by Hossein Pursultani