Skip to content

Commit 93386b4

Browse files
authored
Merge pull request #1497 from SimonHoenscheid/changes_extensions_define
server::extension make user/group/psql_path configureable
2 parents 32114e1 + 1119ec2 commit 93386b4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

manifests/server/extension.pp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
# @param port Port to use when connecting.
2222
# @param connect_settings Specifies a hash of environment variables used when connecting to a remote server.
2323
# @param database_resource_name Specifies the resource name of the DB being managed. Defaults to the parameter $database, if left blank.
24+
# @param psql_path Specifies the path to the psql command.
25+
# @param user Overrides the default PostgreSQL super user and owner of PostgreSQL related files in the file system.
26+
# @param group Overrides the default postgres user group to be used for related files in the file system.
2427
define postgresql::server::extension (
2528
String[1] $database,
2629
Optional[Variant[Enum['present', 'absent', 'purged', 'disabled', 'installed', 'latest'], String[1]]] $package_ensure = undef,
@@ -32,11 +35,10 @@
3235
Optional[Stdlib::Port] $port = undef,
3336
Hash $connect_settings = postgresql::default('default_connect_settings'),
3437
String[1] $database_resource_name = $database,
38+
String[1] $user = postgresql::default('user'),
39+
String[1] $group = postgresql::default('group'),
40+
Stdlib::Absolutepath $psql_path = postgresql::default('psql_path'),
3541
) {
36-
$user = postgresql::default('user')
37-
$group = postgresql::default('group')
38-
$psql_path = postgresql::default('psql_path')
39-
4042
if( $database != 'postgres' ) {
4143
# The database postgres cannot managed by this module, so it is exempt from this dependency
4244
$default_psql_require = Postgresql::Server::Database[$database_resource_name]
@@ -86,12 +88,10 @@
8688
}
8789

8890
postgresql_psql { "${database}: ${command}":
89-
9091
psql_user => $user,
9192
psql_group => $group,
9293
psql_path => $psql_path,
9394
connect_settings => $connect_settings,
94-
9595
db => $database,
9696
port => $port_override,
9797
command => $command,

0 commit comments

Comments
 (0)