Skip to content

Commit cf8a119

Browse files
authored
Merge pull request #878 from AntagonistHQ/checksums
add data_checksums option to initdb
2 parents 9ccf259 + f4276d6 commit cf8a119

File tree

5 files changed

+17
-1
lines changed

5 files changed

+17
-1
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,12 @@ Default value: `undef`, which is effectively 'C'.
479479

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

482+
##### `data_checksums`
483+
484+
Optional boolean to turn on data checksums during `initdb`.
485+
486+
Default value: `undef`, which is the same as `false`.
487+
482488
##### `timezone`
483489

484490
Sets the default timezone of the postgresql server. The postgresql built-in default is taking the systems timezone information.

manifests/globals.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050

5151
$encoding = undef,
5252
$locale = undef,
53+
$data_checksums = undef,
5354
$timezone = undef,
5455

5556
$manage_pg_hba_conf = undef,

manifests/params.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
$ipv6acls = []
1212
$encoding = $postgresql::globals::encoding
1313
$locale = $postgresql::globals::locale
14+
$data_checksums = $postgresql::globals::data_checksums
1415
$timezone = $postgresql::globals::timezone
1516
$service_ensure = 'running'
1617
$service_enable = true

manifests/server.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848

4949
$encoding = $postgresql::params::encoding,
5050
$locale = $postgresql::params::locale,
51+
$data_checksums = $postgresql::params::data_checksums,
5152
$timezone = $postgresql::params::timezone,
5253

5354
$manage_pg_hba_conf = $postgresql::params::manage_pg_hba_conf,

manifests/server/initdb.pp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
$logdir = $postgresql::server::logdir
88
$encoding = $postgresql::server::encoding
99
$locale = $postgresql::server::locale
10+
$data_checksums = $postgresql::server::data_checksums
1011
$group = $postgresql::server::group
1112
$user = $postgresql::server::user
1213
$psql_path = $postgresql::server::psql_path
@@ -82,11 +83,17 @@
8283
$require_before_initdb = [$datadir]
8384
}
8485

85-
$initdb_command = $locale ? {
86+
$ic_locale = $locale ? {
8687
undef => $ic_xlog,
8788
default => "${ic_xlog} --locale '${locale}'"
8889
}
8990

91+
$initdb_command = $data_checksums ? {
92+
undef => $ic_locale,
93+
false => $ic_locale,
94+
default => "${ic_locale} --data-checksums"
95+
}
96+
9097
# This runs the initdb command, we use the existance of the PG_VERSION
9198
# file to ensure we don't keep running this command.
9299
exec { 'postgresql_initdb':

0 commit comments

Comments
 (0)