|
18 | 18 | # Get current peadm config before making modifications and shutting down |
19 | 19 | # PuppetDB |
20 | 20 | $peadm_config = run_task('peadm::get_peadm_config', $primary_target).first.value |
| 21 | + $pe_ver = $peadm_config['pe_version'] |
21 | 22 |
|
22 | 23 | $compilers = $peadm_config['params']['compilers'] |
23 | 24 |
|
|
41 | 42 | $operating_mode = $mode |
42 | 43 | out::message("Operating mode overridden by parameter mode set to ${mode}") |
43 | 44 | } else { |
44 | | - # If array is empty then no external databases were previously configured |
| 45 | + # If array is empty then no external databases were previously configured |
45 | 46 | $no_external_db = peadm::flatten_compact([ |
46 | 47 | $postgresql_a_host, |
47 | 48 | $postgresql_b_host, |
|
87 | 88 |
|
88 | 89 | peadm::plan_step('init-db-node') || { |
89 | 90 | # Install PSQL on new node to be used as external PuppetDB backend by using |
90 | | - # puppet in lieu of installer |
| 91 | + # puppet in lieu of installer |
91 | 92 | run_plan('peadm::subplans::component_install', $postgresql_target, |
92 | 93 | primary_host => $primary_target, |
93 | 94 | avail_group_letter => $avail_group_letter, |
|
162 | 163 | if $operating_mode == 'init' { |
163 | 164 | # Clean up old puppetdb database on primary and those which were copied to |
164 | 165 | # new host. |
165 | | - $target_db_purge = [ |
166 | | - 'pe-activity', |
167 | | - 'pe-classifier', |
168 | | - 'pe-inventory', |
169 | | - 'pe-orchestrator', |
170 | | - 'pe-rbac', |
171 | | - ] |
| 166 | + $target_db_purge = peadm::pe_db_names($pe_ver) |
172 | 167 |
|
173 | 168 | # If a primary replica exists then pglogical is enabled and will prevent |
174 | | - # the clean up of databases on our target because it opens a connection. |
| 169 | + # the clean up of databases on our target because it opens a connection. |
175 | 170 | if $replica_host { |
176 | 171 | run_plan('peadm::util::db_disable_pglogical', $postgresql_target, databases => $target_db_purge) |
177 | 172 | } |
|
0 commit comments