From ae38fa6f83e3009c0d98d5c1d6fce2017e926087 Mon Sep 17 00:00:00 2001 From: Adrian Dvergsdal Date: Tue, 21 Mar 2017 14:34:07 +0100 Subject: [PATCH] enhance --data-checksums on initdb --- README.md | 30 ++++++++++++++++++++---------- manifests/params.pp | 4 ++++ 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 57ca9ca1ff..5dfe275468 100644 --- a/README.md +++ b/README.md @@ -449,6 +449,16 @@ Default value: OS dependent. **Warning:** If datadir is changed from the default, Puppet does not manage purging of the original data directory, which causes it to fail if the data directory is changed back to the original. +##### `data_checksums` + +Optional. + +Data type: Boolean. + +Use checksums on data pages to help detect corruption by the I/O system that would otherwise be silent. Valid values: 'true' or 'false'. Default: initdb's default ('false'). + +**Warning:** This option is used during initialization by initdb, and cannot be changed later. If set, checksums are calculated for all objects, in all databases. + ##### `default_database` Specifies the name of the default database to connect with. @@ -499,16 +509,6 @@ 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. - -Data type: Boolean. - -Turns 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. @@ -751,6 +751,16 @@ The name of the PostgreSQL Python package. Default value: '${bindir}/createdb'. +##### `data_checksums` + +Optional. + +Data type: Boolean. + +Use checksums on data pages to help detect corruption by the I/O system that would otherwise be silent. Valid values: 'true' or 'false'. Default: initdb's default ('false'). + +**Warning:** This option is used during initialization by initdb, and cannot be changed later. If set, checksums are calculated for all objects, in all databases. + ##### `default_database` Specifies the name of the default database to connect with. On most systems this is 'postgres'. diff --git a/manifests/params.pp b/manifests/params.pp index 51c45ef3d6..44ff66458d 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -309,6 +309,10 @@ } } + if($data_checksums and versioncmp($version, '9.3') < 0) { + fail('data_checksums require version 9.3 or greater') + } + $validcon_script_path = pick($validcon_script_path, '/usr/local/bin/validate_postgresql_connection.sh') $initdb_path = pick($initdb_path, "${bindir}/initdb") $pg_hba_conf_path = pick($pg_hba_conf_path, "${confdir}/pg_hba.conf")