Skip to content

Commit 0cd6b1d

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 0cd6b1d

File tree

4 files changed

+35
-3
lines changed

4 files changed

+35
-3
lines changed

functions/migration_opts_default.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ function peadm::migration_opts_default () {
77
'config' => false,
88
'orchestrator' => true,
99
'puppetdb' => true,
10-
'rbac' => true,
10+
'rbac' => false,
1111
}
1212
}

plans/backup.pp

Lines changed: 1 addition & 1 deletion
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 = {},

plans/migrate.pp

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+
$old_pe_conf = peadm::get_pe_conf(peadm::get_targets($old_primary_host, 1)[0])
20+
run_plan('peadm::install', {
21+
primary_host => $new_primary_host,
22+
console_password => $old_pe_conf['console_admin_password'],
23+
code_manager_auto_configure => true,
24+
download_mode => 'direct',
25+
})
26+
27+
run_plan('peadm::restore', {
28+
targets => $new_primary_host,
29+
restore_type => 'migration',
30+
input_file => $remote_backup_path,
31+
})
32+
}

plans/restore.pp

Lines changed: 1 addition & 1 deletion
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)