Skip to content

Commit

Permalink
Merge pull request #1136 from jfroche/feat/extension-db-name
Browse files Browse the repository at this point in the history
feat: enable different database resource name in extension
  • Loading branch information
carabasdaniel authored Feb 6, 2020
2 parents d5d7444 + 8ea21ec commit 6c98cbc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion manifests/server/extension.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# @param package_name Specifies a package to install prior to activating the extension.
# @param package_ensure Overrides default package deletion behavior. By default, the package specified with package_name is installed when the extension is activated and removed when the extension is deactivated. To override this behavior, set the ensure value for the package.
# @param connect_settings Specifies a hash of environment variables used when connecting to a remote server.
# @param database_resource_name Specifies the resource name of the DB being managed. Defaults to the parameter $database, if left blank.
define postgresql::server::extension (
$database,
$extension = $name,
Expand All @@ -23,6 +24,7 @@
$package_name = undef,
$package_ensure = undef,
$connect_settings = $postgresql::server::default_connect_settings,
$database_resource_name = $database,
) {
$user = $postgresql::server::user
$group = $postgresql::server::group
Expand Down Expand Up @@ -51,7 +53,7 @@
if( $database != 'postgres' ) {
# The database postgres cannot managed by this module, so it is exempt from this dependency
Postgresql_psql {
require => Postgresql::Server::Database[$database],
require => Postgresql::Server::Database[$database_resource_name],
}
}

Expand Down

0 comments on commit 6c98cbc

Please sign in to comment.