From f4276d65efd8b8a56386bdbf35171a6c2900a9cd Mon Sep 17 00:00:00 2001 From: Sander Hoentjen Date: Thu, 1 Jun 2017 10:50:05 +0200 Subject: [PATCH] add data_checksums option to initdb --- README.md | 6 ++++++ manifests/globals.pp | 1 + manifests/params.pp | 1 + manifests/server.pp | 1 + manifests/server/initdb.pp | 9 ++++++++- 5 files changed, 17 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fa80ca4a59..f6bcf057cc 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/manifests/globals.pp b/manifests/globals.pp index 5fa248fd30..36e61af489 100644 --- a/manifests/globals.pp +++ b/manifests/globals.pp @@ -50,6 +50,7 @@ $encoding = undef, $locale = undef, + $data_checksums = undef, $timezone = undef, $manage_pg_hba_conf = undef, diff --git a/manifests/params.pp b/manifests/params.pp index cf3abe85f4..51c45ef3d6 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -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 diff --git a/manifests/server.pp b/manifests/server.pp index 306410eb18..7509ec97e1 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -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, diff --git a/manifests/server/initdb.pp b/manifests/server/initdb.pp index 2252a198f1..7eb0652c89 100644 --- a/manifests/server/initdb.pp +++ b/manifests/server/initdb.pp @@ -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 @@ -82,11 +83,17 @@ $require_before_initdb = [$datadir] } - $initdb_command = $locale ? { + $ic_locale = $locale ? { 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':