File tree Expand file tree Collapse file tree 4 files changed +15
-2
lines changed Expand file tree Collapse file tree 4 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 4747 $repo_baseurl = undef ,
4848
4949 $needs_initdb = undef ,
50+ $data_checksums = undef ,
5051
5152 $encoding = undef ,
5253 $locale = undef ,
Original file line number Diff line number Diff line change 1212 $encoding = $postgresql::globals::encoding
1313 $locale = $postgresql::globals::locale
1414 $timezone = $postgresql::globals::timezone
15+ $data_checksums = $postgresql::globals::data_checksums
1516 $service_ensure = ' running'
1617 $service_enable = true
1718 $service_manage = true
308309 }
309310 }
310311
312+ if ($data_checksums && versioncmp($globals_version , ' 9.3' ) < 0) {
313+ fail(' data_checksums require version 9.3 or greater' )
314+ }
315+
311316 $validcon_script_path = pick($validcon_script_path , ' /usr/local/bin/validate_postgresql_connection.sh' )
312317 $initdb_path = pick($initdb_path , " ${bindir} /initdb" )
313318 $pg_hba_conf_path = pick($pg_hba_conf_path , " ${confdir} /pg_hba.conf" )
Original file line number Diff line number Diff line change 4545 $group = $postgresql::params::group,
4646
4747 $needs_initdb = $postgresql::params::needs_initdb,
48+ $data_checksums = $postgresql::params::data_checksums,
4849
4950 $encoding = $postgresql::params::encoding,
5051 $locale = $postgresql::params::locale,
Original file line number Diff line number Diff line change 11# PRIVATE CLASS: do not call directly
22class postgresql::server::initdb {
33 $needs_initdb = $postgresql::server::needs_initdb
4+ $data_checksums = $postgresql::server::data_checksums
45 $initdb_path = $postgresql::server::initdb_path
56 $datadir = $postgresql::server::datadir
67 $xlogdir = $postgresql::server::xlogdir
7475 default => " ${ic_base} --xlogdir '${xlogdir} '"
7576 }
7677
78+ $ic_checksums = $data_checksums ? {
79+ true => " ${ic_xlog} --data-checksums" ,
80+ default => $ic_xlog ,
81+ }
82+
7783 # The xlogdir need to be present before initdb runs.
7884 # If xlogdir is default it's created by package installer
7985 if ($xlogdir ) {
8389 }
8490
8591 $initdb_command = $locale ? {
86- undef => $ic_xlog ,
87- default => " ${ic_xlog } --locale '${locale} '"
92+ undef => $ic_checksums ,
93+ default => " ${ic_checksum } --locale '${locale} '"
8894 }
8995
9096 # This runs the initdb command, we use the existance of the PG_VERSION
You can’t perform that action at this time.
0 commit comments