Skip to content

Commit 4bed1ce

Browse files
author
petergmurphy
committed
(PE-40371) Add migration plan for standard architecture
This commit adds a migration plan which utilises backup, install and restore plans to install and restore PE on new infrastructure with a standard architecture. This commit also introduces a new 'migration' option for backup and restore plans, enabling a new migration plan.
1 parent 80d18de commit 4bed1ce

File tree

3 files changed

+33
-2
lines changed

3 files changed

+33
-2
lines changed

Diff for: plans/backup.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
Peadm::SingleTargetSpec $targets,
1313

1414
# backup type determines the backup options
15-
Enum['recovery', 'custom'] $backup_type = 'recovery',
15+
Enum['recovery', 'custom', 'migration'] $backup_type = 'recovery',
1616

1717
# Which data to backup
1818
Peadm::Recovery_opts $backup = {},

Diff for: plans/migrate.pp

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
plan peadm::migrate (
2+
Peadm::SingleTargetSpec $old_primary_host,
3+
Peadm::SingleTargetSpec $new_primary_host,
4+
) {
5+
peadm::assert_supported_bolt_version()
6+
7+
$backup_file = run_plan('peadm::backup', $old_primary_host, {
8+
backup_type => 'migration',
9+
})
10+
11+
download_file($backup_file['path'], 'backup', $old_primary_host)
12+
13+
$backup_filename = basename($backup_file['path'])
14+
$remote_backup_path = "/tmp/${backup_filename}"
15+
$current_dir = system::env('PWD')
16+
17+
upload_file("${current_dir}/downloads/backup/${old_primary_host}/${backup_filename}", $remote_backup_path, $new_primary_host)
18+
19+
run_plan('peadm::install', {
20+
primary_host => $new_primary_host,
21+
console_password => 'Puppetlabs123!',
22+
code_manager_auto_configure => true,
23+
download_mode => 'direct',
24+
})
25+
26+
run_plan('peadm::restore', {
27+
targets => $new_primary_host,
28+
restore_type => 'migration',
29+
input_file => $remote_backup_path,
30+
})
31+
}

Diff for: plans/restore.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
Peadm::SingleTargetSpec $targets,
1313

1414
# restore type determines the restore options
15-
Enum['recovery', 'recovery-db', 'custom'] $restore_type = 'recovery',
15+
Enum['recovery', 'recovery-db', 'custom', 'migration'] $restore_type = 'recovery',
1616

1717
# Which data to restore
1818
Peadm::Recovery_opts $restore = {},

0 commit comments

Comments
 (0)