feat: manage database/user/grants for patroni

- add defines for exporting/collecting psql objects for patroni
- add generic profile for managing patroni psql databases for an app
This commit is contained in:
2024-08-24 00:30:47 +10:00
parent 68c569b282
commit 8fad79f2bc
5 changed files with 127 additions and 0 deletions
+10
View File
@@ -84,6 +84,16 @@ class profiles::sql::patroni (
],
}
$connect_settings = {
}
# collect exported resources
$tag = "${facts['country']}-${facts['region']}-${facts['environment']}"
Profiles::Sql::Postgres::Db <<| tag == $tag |>> {}
Profiles::Sql::Postgres::User <<| tag == $tag |>> {}
Profiles::Sql::Postgres::Grant <<| tag == $tag |>> {}
if $postgres_exporter_enabled {
class { 'prometheus::postgres_exporter':
postgres_user => $postgres_exporter_user,