Skip to content

Commit 77f456a

Browse files
Matt Darcyjst-cyr
authored andcommitted
add database parameter to support database creation in server::database.pp
1 parent a59cf87 commit 77f456a

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

manifests/server.pp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
# @param pg_hba_auth_password_encryption
100100
# Specify the type of encryption set for the password in pg_hba_conf,
101101
# this value is usefull if you want to start enforcing scram-sha-256, but give users transition time.
102+
# @param databases Specifies a hash from which to generate postgresql::server::database resources.
102103
# @param roles Specifies a hash from which to generate postgresql::server::role resources.
103104
# @param grants Specifies a hash from which to generate postgresql::server::grant resources.
104105
# @param config_entries Specifies a hash from which to generate postgresql::server::config_entry resources.
@@ -185,6 +186,7 @@
185186
Optional[Postgresql::Pg_password_encryption] $pg_hba_auth_password_encryption = undef,
186187
Optional[String] $extra_systemd_config = $postgresql::params::extra_systemd_config,
187188

189+
Hash[String[1], Hash] $databases = {},
188190
Hash[String, Hash] $roles = {},
189191
Hash[String[1], Hash] $grants = {},
190192
Hash[String, Any] $config_entries = {},
@@ -213,6 +215,12 @@
213215
-> Class['postgresql::server::service']
214216
-> Class['postgresql::server::passwd']
215217

218+
$databases.each |$databasename, $database| {
219+
postgresql::server::database { $databasename:
220+
* => $database,
221+
}
222+
}
223+
216224
$roles.each |$rolename, $role| {
217225
postgresql::server::role { $rolename:
218226
* => $role,

0 commit comments

Comments
 (0)