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
@@ -0,0 +1,9 @@
define profiles::sql::postgres::db (
String $dbname,
) {
postgresql_psql { "create_database_${dbname}":
command => "CREATE DATABASE \"${dbname}\"",
unless => "SELECT 1 FROM pg_database WHERE datname = '${dbname}'",
}
}