|
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 | 7 | # Manage the inclusion of the pg_repack class
|
8 | 8 | Boolean $manage_database_maintenance = true,
|
9 | 9 | # Manage the state of the maintenance tasks, i.e. systemd services and timers
|
|
31 | 31 | }
|
32 | 32 |
|
33 | 33 | if $facts.dig('pe_databases', 'have_systemd') {
|
34 |
| - if $manage_database_maintenance and (versioncmp('2019.0.2', $facts['pe_server_version']) <= 0) { |
35 |
| - class {'pe_databases::pg_repack': |
36 |
| - disable_maintenance => $disable_maintenance, |
| 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 | + } |
37 | 45 | }
|
38 |
| - if $manage_table_settings { |
39 |
| - # This is to provide for situations, like PE XL, |
40 |
| - # where the pe-puppetdb database does not exist on the PostgreSQL system being tuned. |
41 |
| - # In PE XL, the Master and Replica run PostgreSQL for all databases *except* for pe-puppetdb. |
42 |
| - include pe_databases::postgresql_settings::table_settings |
43 |
| - } |
44 |
| - |
45 |
| - if $manage_database_backups { |
46 |
| - include pe_databases::backup |
| 46 | + if defined('$manage_database_backups') { |
| 47 | + class { 'pe_databases::backup': |
| 48 | + disable_maintenance => ! $manage_database_backups, |
| 49 | + } |
47 | 50 | }
|
48 | 51 | }
|
49 | 52 | else {
|
|
0 commit comments