|
3 | 3 | # @summary Tuning, maintenance, and backups for PE PostgreSQL.
|
4 | 4 |
|
5 | 5 | class pe_databases (
|
6 |
| - Boolean $manage_database_backups = false, |
| 6 | + Variant[Boolean,Undef] $manage_database_backups = undef, |
| 7 | + # Manage the inclusion of the pg_repack class |
7 | 8 | Boolean $manage_database_maintenance = true,
|
| 9 | + # Manage the state of the maintenance tasks, i.e. systemd services and timers |
| 10 | + Boolean $disable_maintenance = lookup('pe_databases::disable_maintenance', {'default_value' => false}), |
8 | 11 | Boolean $manage_postgresql_settings = true,
|
9 | 12 | Boolean $manage_table_settings = true,
|
10 | 13 | String $install_dir = '/opt/puppetlabs/pe_databases',
|
|
28 | 31 | }
|
29 | 32 |
|
30 | 33 | 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 | + if versioncmp('2019.0.2', $facts['pe_server_version']) <= 0 { |
| 35 | + if $manage_database_maintenance { |
| 36 | + class {'pe_databases::pg_repack': |
| 37 | + disable_maintenance => $disable_maintenance, |
| 38 | + } |
| 39 | + if $manage_table_settings { |
| 40 | + # This is to provide for situations, like PE XL, |
| 41 | + # where the pe-puppetdb database does not exist on the PostgreSQL system being tuned. |
| 42 | + # In PE XL, the Master and Replica run PostgreSQL for all databases *except* for pe-puppetdb. |
| 43 | + include pe_databases::postgresql_settings::table_settings |
| 44 | + } |
34 | 45 | }
|
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 |
| 46 | + if defined('$manage_database_backups') { |
| 47 | + class { 'pe_databases::backup': |
| 48 | + disable_maintenance => ! $manage_database_backups, |
| 49 | + } |
44 | 50 | }
|
45 | 51 | }
|
46 | 52 | else {
|
|
0 commit comments