Skip to content

Commit 0998784

Browse files
author
Matt Darcy
committed
add database parameter to support database creation in server::database.pp
1 parent 49368d1 commit 0998784

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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 config_entries Specifies a hash from which to generate postgresql::server::config_entry resources.
104105
# @param pg_hba_rules Specifies a hash from which to generate postgresql::server::pg_hba_rule resources.
@@ -184,6 +185,7 @@
184185
Optional[Postgresql::Pg_password_encryption] $pg_hba_auth_password_encryption = undef,
185186
Optional[String] $extra_systemd_config = $postgresql::params::extra_systemd_config,
186187

188+
Hash[String, Hash] $databases = {},
187189
Hash[String, Hash] $roles = {},
188190
Hash[String, Any] $config_entries = {},
189191
Postgresql::Pg_hba_rules $pg_hba_rules = {},
@@ -211,6 +213,12 @@
211213
-> Class['postgresql::server::service']
212214
-> Class['postgresql::server::passwd']
213215

216+
$databases.each |$databasename, $database| {
217+
postgresql::server::database { $databasename:
218+
* => $database,
219+
}
220+
}
221+
214222
$roles.each |$rolename, $role| {
215223
postgresql::server::role { $rolename:
216224
* => $role,

0 commit comments

Comments
 (0)