|
21 | 21 | # @param port Port to use when connecting.
|
22 | 22 | # @param connect_settings Specifies a hash of environment variables used when connecting to a remote server.
|
23 | 23 | # @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. |
24 | 27 | define postgresql::server::extension (
|
25 | 28 | String[1] $database,
|
26 | 29 | Optional[Variant[Enum['present', 'absent', 'purged', 'disabled', 'installed', 'latest'], String[1]]] $package_ensure = undef,
|
|
32 | 35 | Optional[Stdlib::Port] $port = undef,
|
33 | 36 | Hash $connect_settings = postgresql::default('default_connect_settings'),
|
34 | 37 | 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'), |
35 | 41 | ) {
|
36 |
| - $user = postgresql::default('user') |
37 |
| - $group = postgresql::default('group') |
38 |
| - $psql_path = postgresql::default('psql_path') |
39 |
| - |
40 | 42 | if( $database != 'postgres' ) {
|
41 | 43 | # The database postgres cannot managed by this module, so it is exempt from this dependency
|
42 | 44 | $default_psql_require = Postgresql::Server::Database[$database_resource_name]
|
|
86 | 88 | }
|
87 | 89 |
|
88 | 90 | postgresql_psql { "${database}: ${command}":
|
89 |
| - |
90 | 91 | psql_user => $user,
|
91 | 92 | psql_group => $group,
|
92 | 93 | psql_path => $psql_path,
|
93 | 94 | connect_settings => $connect_settings,
|
94 |
| - |
95 | 95 | db => $database,
|
96 | 96 | port => $port_override,
|
97 | 97 | command => $command,
|
|
0 commit comments