|
9 | 9 | # @param locale Overrides the locale during creation of the database.
|
10 | 10 | # @param istemplate Defines the database as a template if set to true.
|
11 | 11 | # @param connect_settings Specifies a hash of environment variables used when connecting to a remote server.
|
| 12 | +# @param psql_path Specifies the path to the psql command. |
| 13 | +# @param default_db Specifies the name of the default database to connect with. On most systems this is 'postgres'. |
| 14 | +# @param user Overrides the default PostgreSQL super user and owner of PostgreSQL related files in the file system. |
| 15 | +# @param group Overrides the default postgres user group to be used for related files in the file system. |
| 16 | +# @param port Specifies the port for the PostgreSQL server to listen on. |
12 | 17 | define postgresql::server::database (
|
13 |
| - Optional[String[1]] $comment = undef, |
14 |
| - String[1] $dbname = $title, |
15 |
| - Optional[String[1]] $owner = undef, |
16 |
| - Optional[String[1]] $tablespace = undef, |
17 |
| - String[1] $template = 'template0', |
18 |
| - Optional[String[1]] $encoding = $postgresql::server::encoding, |
19 |
| - Optional[String[1]] $locale = $postgresql::server::locale, |
20 |
| - Boolean $istemplate = false, |
21 |
| - Hash $connect_settings = $postgresql::server::default_connect_settings, |
| 18 | + Optional[String[1]] $comment = undef, |
| 19 | + String[1] $dbname = $title, |
| 20 | + Optional[String[1]] $owner = undef, |
| 21 | + Optional[String[1]] $tablespace = undef, |
| 22 | + String[1] $template = 'template0', |
| 23 | + Optional[String[1]] $encoding = $postgresql::server::encoding, |
| 24 | + Optional[String[1]] $locale = $postgresql::server::locale, |
| 25 | + Boolean $istemplate = false, |
| 26 | + Hash $connect_settings = $postgresql::server::default_connect_settings, |
| 27 | + String[1] $user = $postgresql::server::user, |
| 28 | + String[1] $group = $postgresql::server::group, |
| 29 | + Stdlib::Absolutepath $psql_path = $postgresql::server::psql_path, |
| 30 | + String[1] $default_db = $postgresql::server::default_database, |
| 31 | + Stdlib::Port $port = $postgresql::server::port |
22 | 32 | ) {
|
23 |
| - $user = $postgresql::server::user |
24 |
| - $group = $postgresql::server::group |
25 |
| - $psql_path = $postgresql::server::psql_path |
26 |
| - $default_db = $postgresql::server::default_database |
27 |
| - |
28 | 33 | # If possible use the version of the remote database, otherwise
|
29 | 34 | # fallback to our local DB version
|
30 | 35 | if 'DBVERSION' in $connect_settings {
|
|
35 | 40 |
|
36 | 41 | # If the connection settings do not contain a port, then use the local server port
|
37 | 42 | if 'PGPORT' in $connect_settings {
|
38 |
| - $port = undef |
| 43 | + $port_override = undef |
39 | 44 | } else {
|
40 |
| - $port = $postgresql::server::port |
| 45 | + $port_override = $port |
41 | 46 | }
|
42 | 47 |
|
43 | 48 | # Set the defaults for the postgresql_psql resource
|
|
46 | 51 | psql_user => $user,
|
47 | 52 | psql_group => $group,
|
48 | 53 | psql_path => $psql_path,
|
49 |
| - port => $port, |
| 54 | + port => $port_override, |
50 | 55 | connect_settings => $connect_settings,
|
51 | 56 | }
|
52 | 57 |
|
|
0 commit comments