Skip to content

Commit 889811f

Browse files
Merge pull request #1510 from SimonHoenscheid/initdb_parameters
add port and psql_path parameter to initdb define
2 parents f9204d5 + 71e446a commit 889811f

File tree

2 files changed

+47
-18
lines changed

2 files changed

+47
-18
lines changed

REFERENCE.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2673,6 +2673,8 @@ The following parameters are available in the `postgresql::server::instance::ini
26732673
* [`user`](#-postgresql--server--instance--initdb--user)
26742674
* [`username`](#-postgresql--server--instance--initdb--username)
26752675
* [`xlogdir`](#-postgresql--server--instance--initdb--xlogdir)
2676+
* [`port`](#-postgresql--server--instance--initdb--port)
2677+
* [`psql_path`](#-postgresql--server--instance--initdb--psql_path)
26762678

26772679
##### <a name="-postgresql--server--instance--initdb--auth_host"></a>`auth_host`
26782680

@@ -2824,6 +2826,24 @@ PostgreSQL xlog/WAL directory
28242826

28252827
Default value: `$postgresql::server::xlogdir`
28262828

2829+
##### <a name="-postgresql--server--instance--initdb--port"></a>`port`
2830+
2831+
Data type: `Stdlib::Port`
2832+
2833+
Specifies the port for the PostgreSQL server to listen on.
2834+
Note: The same port number is used for all IP addresses the server listens on. Also, for Red Hat systems and early Debian systems,
2835+
changing the port causes the server to come to a full stop before being able to make the change.
2836+
2837+
Default value: `$postgresql::server::port`
2838+
2839+
##### <a name="-postgresql--server--instance--initdb--psql_path"></a>`psql_path`
2840+
2841+
Data type: `Stdlib::Absolutepath`
2842+
2843+
Specifies the path to the psql command.
2844+
2845+
Default value: `$postgresql::server::psql_path`
2846+
28272847
### <a name="postgresql--server--instance--late_initdb"></a>`postgresql::server::instance::late_initdb`
28282848

28292849
Manage the default encoding when database initialization is managed by the package

manifests/server/instance/initdb.pp

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,32 @@
2525
# @param user Overrides the default PostgreSQL super user and owner of PostgreSQL related files in the file system.
2626
# @param username username of user running the postgres instance
2727
# @param xlogdir PostgreSQL xlog/WAL directory
28+
# @param port
29+
# Specifies the port for the PostgreSQL server to listen on.
30+
# Note: The same port number is used for all IP addresses the server listens on. Also, for Red Hat systems and early Debian systems,
31+
# changing the port causes the server to come to a full stop before being able to make the change.
32+
# @param psql_path Specifies the path to the psql command.
2833
define postgresql::server::instance::initdb (
29-
Optional[String[1]] $auth_host = $postgresql::server::auth_host,
30-
Optional[String[1]] $auth_local = $postgresql::server::auth_local,
31-
Optional[Boolean] $data_checksums = $postgresql::server::data_checksums,
32-
Stdlib::Absolutepath $datadir = $postgresql::server::datadir,
33-
Optional[String[1]] $encoding = $postgresql::server::encoding,
34-
String[1] $group = $postgresql::server::group,
35-
Stdlib::Absolutepath $initdb_path = $postgresql::server::initdb_path,
36-
Optional[String[1]] $lc_messages = $postgresql::server::lc_messages,
37-
Optional[String[1]] $locale = $postgresql::server::locale,
38-
Optional[Stdlib::Absolutepath] $logdir = $postgresql::server::logdir,
39-
Boolean $manage_datadir = $postgresql::server::manage_datadir,
40-
Boolean $manage_logdir = $postgresql::server::manage_logdir,
41-
Boolean $manage_xlogdir = $postgresql::server::manage_xlogdir,
42-
Stdlib::Absolutepath $module_workdir = $postgresql::server::module_workdir,
43-
Boolean $needs_initdb = $postgresql::server::needs_initdb,
44-
String[1] $user = $postgresql::server::user,
45-
Optional[String[1]] $username = $postgresql::server::username,
46-
Optional[Stdlib::Absolutepath] $xlogdir = $postgresql::server::xlogdir,
34+
Optional[String[1]] $auth_host = $postgresql::server::auth_host,
35+
Optional[String[1]] $auth_local = $postgresql::server::auth_local,
36+
Optional[Boolean] $data_checksums = $postgresql::server::data_checksums,
37+
Stdlib::Absolutepath $datadir = $postgresql::server::datadir,
38+
Optional[String[1]] $encoding = $postgresql::server::encoding,
39+
String[1] $group = $postgresql::server::group,
40+
Stdlib::Absolutepath $initdb_path = $postgresql::server::initdb_path,
41+
Optional[String[1]] $lc_messages = $postgresql::server::lc_messages,
42+
Optional[String[1]] $locale = $postgresql::server::locale,
43+
Optional[Stdlib::Absolutepath] $logdir = $postgresql::server::logdir,
44+
Boolean $manage_datadir = $postgresql::server::manage_datadir,
45+
Boolean $manage_logdir = $postgresql::server::manage_logdir,
46+
Boolean $manage_xlogdir = $postgresql::server::manage_xlogdir,
47+
Stdlib::Absolutepath $module_workdir = $postgresql::server::module_workdir,
48+
Boolean $needs_initdb = $postgresql::server::needs_initdb,
49+
String[1] $user = $postgresql::server::user,
50+
Optional[String[1]] $username = $postgresql::server::username,
51+
Optional[Stdlib::Absolutepath] $xlogdir = $postgresql::server::xlogdir,
52+
Stdlib::Port $port = $postgresql::server::port,
53+
Stdlib::Absolutepath $psql_path = $postgresql::server::psql_path,
4754
) {
4855
if $facts['os']['family'] == 'RedHat' and $facts['os']['selinux']['enabled'] == true {
4956
$seltype = 'postgresql_db_t'
@@ -190,6 +197,8 @@
190197
user => $user,
191198
group => $group,
192199
module_workdir => $module_workdir,
200+
psql_path => $psql_path,
201+
port => $port,
193202
}
194203
}
195204
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy