From badd0a07ee80e3d3b1a93ee1a8861c1d4a68b475 Mon Sep 17 00:00:00 2001 From: Matt Darcy Date: Sun, 15 Feb 2026 18:08:39 +0000 Subject: [PATCH] add database parameter to support database creation in server::database.pp --- manifests/server.pp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/manifests/server.pp b/manifests/server.pp index cf3bda0848..30271dd88e 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -99,6 +99,7 @@ # @param pg_hba_auth_password_encryption # Specify the type of encryption set for the password in pg_hba_conf, # this value is usefull if you want to start enforcing scram-sha-256, but give users transition time. +# @param databases Specifies a hash from which to generate postgresql::server::database resources. # @param roles Specifies a hash from which to generate postgresql::server::role resources. # @param grants Specifies a hash from which to generate postgresql::server::grant resources. # @param config_entries Specifies a hash from which to generate postgresql::server::config_entry resources. @@ -185,6 +186,7 @@ Optional[Postgresql::Pg_password_encryption] $pg_hba_auth_password_encryption = undef, Optional[String] $extra_systemd_config = $postgresql::params::extra_systemd_config, + Hash[String[1], Hash] $databases = {}, Hash[String, Hash] $roles = {}, Hash[String[1], Hash] $grants = {}, Hash[String, Any] $config_entries = {}, @@ -213,6 +215,12 @@ -> Class['postgresql::server::service'] -> Class['postgresql::server::passwd'] + $databases.each |$databasename, $database| { + postgresql::server::database { $databasename: + * => $database, + } + } + $roles.each |$rolename, $role| { postgresql::server::role { $rolename: * => $role,