Skip to content

Commit 8a3203d

Browse files
committed
-
1 parent be0fb06 commit 8a3203d

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

plans/migrate.pp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,29 @@
99
Peadm::SingleTargetSpec $old_primary_host,
1010
Peadm::SingleTargetSpec $new_primary_host,
1111
) {
12+
# pre-migration checks
1213
peadm::assert_supported_bolt_version()
14+
peadm::assert_supported_pe_version($pe_version, $permit_unsafe_versions)
15+
16+
$all_hosts = peadm::flatten_compact([
17+
$old_primary_host,
18+
$new_primary_host,
19+
])
20+
run_command('hostname', $all_hosts) # verify can connect to targets
21+
22+
# verify the cluster we are migrating from is operational and is a supported architecture
23+
$cluster = run_task('peadm::get_peadm_config', $targets).first.value
24+
$error = getvar('cluster.error')
25+
if $error {
26+
fail_plan($error)
27+
}
28+
$arch = peadm::assert_supported_architecture(
29+
getvar('cluster.params.primary_host'),
30+
getvar('cluster.params.replica_host'),
31+
getvar('cluster.params.primary_postgresql_host'),
32+
getvar('cluster.params.replica_postgresql_host'),
33+
getvar('cluster.params.compiler_hosts'),
34+
)
1335

1436
$backup_file = run_plan('peadm::backup', $old_primary_host, {
1537
backup_type => 'migration',

0 commit comments

Comments
 (0)