|
3 | 3 | # @summary Tuning, maintenance, and backups for PE PostgreSQL. |
4 | 4 |
|
5 | 5 | class pe_databases ( |
6 | | - Boolean $manage_database_backups = true, |
| 6 | + Boolean $manage_database_backups = false, |
7 | 7 | Boolean $manage_database_maintenance = true, |
8 | 8 | Boolean $manage_postgresql_settings = true, |
9 | 9 | Boolean $manage_table_settings = true, |
|
21 | 21 | mode => '0755', |
22 | 22 | } |
23 | 23 |
|
24 | | - if $manage_database_maintenance { |
25 | | - include pe_databases::maintenance |
| 24 | + exec { 'pe_databases_daemon_reload': |
| 25 | + command => 'systemctl daemon-reload', |
| 26 | + path => ['/bin', '/usr/bin'], |
| 27 | + refreshonly => true, |
26 | 28 | } |
27 | 29 |
|
28 | | - # Do not manage postgresql_settings in 2018.1.0 or newer. |
29 | | - if $manage_postgresql_settings and (versioncmp('2018.1.0', $facts['pe_server_version']) > 0) { |
30 | | - include pe_databases::postgresql_settings |
31 | | - class { 'pe_databases::postgresql_settings::table_settings' : |
32 | | - manage_reports_autovacuum_cost_delay => $pe_databases::postgresql_settings::manage_reports_autovacuum_cost_delay, |
33 | | - factsets_autovacuum_vacuum_scale_factor => $pe_databases::postgresql_settings::factsets_autovacuum_vacuum_scale_factor, |
34 | | - reports_autovacuum_vacuum_scale_factor => $pe_databases::postgresql_settings::reports_autovacuum_vacuum_scale_factor, |
35 | | - require => Class['pe_databases::postgresql_settings'], |
| 30 | + if $facts.dig('pe_databases', 'have_systemd') { |
| 31 | + if $manage_database_maintenance and (versioncmp('2019.0.2', $facts['pe_server_version']) <= 0) { |
| 32 | + class {'pe_databases::pg_repack': |
| 33 | + disable_maintenance => lookup('pe_databases::maintenance::disable_maintenance', {'default_value' => false}), |
| 34 | + } |
| 35 | + if $manage_table_settings { |
| 36 | + # This is to provide for situations, like PE XL, |
| 37 | + # where the pe-puppetdb database does not exist on the PostgreSQL system being tuned. |
| 38 | + # In PE XL, the Master and Replica run PostgreSQL for all databases *except* for pe-puppetdb. |
| 39 | + include pe_databases::postgresql_settings::table_settings |
| 40 | + } |
| 41 | + |
| 42 | + if $manage_database_backups { |
| 43 | + include pe_databases::backup |
| 44 | + } |
| 45 | + } |
| 46 | + else { |
| 47 | + notify { 'pe_databases_version_warn': |
| 48 | + message => 'This module only supports PE 2019.0.2 and later', |
| 49 | + loglevel => warning, |
| 50 | + } |
36 | 51 | } |
37 | | - } elsif $manage_table_settings { |
38 | | - # This is to provide for situations, like PE XL, |
39 | | - # where the pe-puppetdb database does not exist on the PostgreSQL system being tuned. |
40 | | - # In PE XL, the Master and Replica run PostgreSQL for all databases *except* for pe-puppetdb. |
41 | | - include pe_databases::postgresql_settings::table_settings |
42 | 52 | } |
43 | | - |
44 | | - if $manage_database_backups { |
45 | | - include pe_databases::backup |
| 53 | + else { |
| 54 | + notify { 'pe_databases_systemd_warn': |
| 55 | + message => 'This module only works with systemd as the provider', |
| 56 | + loglevel => warning, |
| 57 | + } |
46 | 58 | } |
47 | 59 | } |
0 commit comments