Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,12 @@ Default value: `undef`, which is effectively 'C'.

**On Debian, you'll need to ensure that the 'locales-all' package is installed for full functionality of PostgreSQL.**

##### `data_checksums`

Optional boolean to turn on data checksums during `initdb`.

Default value: `undef`, which is the same as `false`.

##### `timezone`

Sets the default timezone of the postgresql server. The postgresql built-in default is taking the systems timezone information.
Expand Down
1 change: 1 addition & 0 deletions manifests/globals.pp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@

$encoding = undef,
$locale = undef,
$data_checksums = undef,
$timezone = undef,

$manage_pg_hba_conf = undef,
Expand Down
1 change: 1 addition & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
$ipv6acls = []
$encoding = $postgresql::globals::encoding
$locale = $postgresql::globals::locale
$data_checksums = $postgresql::globals::data_checksums
$timezone = $postgresql::globals::timezone
$service_ensure = 'running'
$service_enable = true
Expand Down
1 change: 1 addition & 0 deletions manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@

$encoding = $postgresql::params::encoding,
$locale = $postgresql::params::locale,
$data_checksums = $postgresql::params::data_checksums,
$timezone = $postgresql::params::timezone,

$manage_pg_hba_conf = $postgresql::params::manage_pg_hba_conf,
Expand Down
9 changes: 8 additions & 1 deletion manifests/server/initdb.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
$logdir = $postgresql::server::logdir
$encoding = $postgresql::server::encoding
$locale = $postgresql::server::locale
$data_checksums = $postgresql::server::data_checksums
$group = $postgresql::server::group
$user = $postgresql::server::user
$psql_path = $postgresql::server::psql_path
Expand Down Expand Up @@ -82,11 +83,17 @@
$require_before_initdb = [$datadir]
}

$initdb_command = $locale ? {
$ic_locale = $locale ? {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the meaning of this variable name, it is a little terse. was there any reason to rename it ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, it was like this:

$ic_base = "${initdb_path} --encoding '${encoding}' --pgdata '${datadir}'"
$ic_xlog = $ic_base + optional xlogdir
$initdb_command = $ic_xlog + optional locale

Now I changed it so:

$ic_base = "${initdb_path} --encoding '${encoding}' --pgdata '${datadir}'"
$ic_xlog = $ic_base + optional xlogdir
$ic_locale = $ic_xlog + optional locale
$initdb_command = $ic_locale + optional data-checksums

Basically ic_ (probably short for initdb_command) was there before, I just kept the same convention.

undef => $ic_xlog,
default => "${ic_xlog} --locale '${locale}'"
}

$initdb_command = $data_checksums ? {
undef => $ic_locale,
false => $ic_locale,
default => "${ic_locale} --data-checksums"
}

# This runs the initdb command, we use the existance of the PG_VERSION
# file to ensure we don't keep running this command.
exec { 'postgresql_initdb':
Expand Down