Showing with 25 additions and 5 deletions.
  1. +5 −0 CHANGELOG.md
  2. +2 −1 manifests/backup.pp
  3. +6 −0 manifests/init.pp
  4. +11 −3 manifests/postgresql_settings.pp
  5. +1 −1 metadata.json
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## Minor Release 0.11.0

- Prepare for PostgreSQL 9.6 in PE 2017.3.0
- Manage fact_values autovacuum again in 2017.3.0

## Z Release 0.10.1

- Bug Fixes
Expand Down
3 changes: 2 additions & 1 deletion manifests/backup.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
},
}
],
String $backup_directory = '/opt/puppetlabs/server/data/postgresql/9.4/backups',
String $psql_version = $pe_databases::psql_version,
String $backup_directory = "/opt/puppetlabs/server/data/postgresql/${psql_version}/backups",
String $backup_script_path = '/opt/puppetlabs/pe_databases/scripts/puppet_enterprise_database_backup.sh',
String $backup_logging_directory = '/var/log/puppetlabs/pe_databases_backup',
Integer $retention_policy = 2,
Expand Down
6 changes: 6 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
Boolean $manage_postgresql_settings = true,
) {

if ( versioncmp('2017.3.0', $facts['pe_server_version']) >= 0 ) {
$psql_version = '9.6'
} else {
$psql_version = '9.4'
}

if $manage_database_maintenance {
include pe_databases::maintenance
}
Expand Down
14 changes: 11 additions & 3 deletions manifests/postgresql_settings.pp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
false => "${::memory['system']['total_bytes'] / 1024 / 1024 / 3/ $autovacuum_max_workers}MB",
true => "${::memory['system']['total_bytes'] / 1024 / 1024 / 8/ $autovacuum_max_workers}MB",
},
String $psql_version = $pe_databases::psql_version,
) {

$postgresql_service_resource_name = 'postgresqld'
Expand Down Expand Up @@ -50,7 +51,7 @@
#http://www.postgresql.org/docs/9.4/static/runtime-config-autovacuum.html
Postgresql_conf {
ensure => present,
target => '/opt/puppetlabs/server/data/postgresql/9.4/data/postgresql.conf',
target => "/opt/puppetlabs/server/data/postgresql/${psql_version}/data/postgresql.conf",
notify => $notify_postgresql_service,
}

Expand Down Expand Up @@ -94,8 +95,14 @@
value => "${checkpoint_completion_target}",
}

$checkpoint_segments_ensure = $psql_version ? {
'9.4' => 'present',
default => 'absent',
}

postgresql_conf { 'checkpoint_segments' :
value => "${checkpoint_segments}",
ensure => $checkpoint_segments_ensure,
value => "${checkpoint_segments}",
}

if !empty($arbitrary_postgresql_conf_settings) {
Expand All @@ -106,7 +113,8 @@
}
}

if ( versioncmp('2017.2.0', $facts['pe_server_version']) >= 0
if ( ( versioncmp('2017.2.0', $facts['pe_server_version']) > 0 or
versioncmp('2017.3.0', $facts['pe_server_version']) <= 0 )
and $manage_fact_values_autovacuum_cost_delay ) {
pe_databases::set_puppetdb_table_autovacuum_cost_delay_zero { 'fact_values' : }
}
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "npwalker/pe_databases",
"version": "0.10.1",
"version": "0.11.0",
"author": "npwalker",
"summary": "A Puppet Module for Backing Up / Maintaining / Tuning Your Puppet Enterprise Databases",
"license": "Apache-2.0",
Expand Down