Skip to content

Commit

Permalink
(PE-40373) Add optional upgrade to migration plan
Browse files Browse the repository at this point in the history
This commit extends the existing migration plan by adding an optional
upgrade step after the migration is complete. If an upgrade version
is specified, the plan will automatically perform an upgrade to the
new version using the peadm::upgrade plan.
  • Loading branch information
petergmurphy committed Feb 27, 2025
1 parent be0fb06 commit b5c3cfb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions plans/migrate.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@
# The existing PE primary server that will be migrated from
# @param new_primary_host
# The new server that will become the PE primary server
# @param upgrade_version
# Optional version to upgrade to after migration is complete
#
plan peadm::migrate (
Peadm::SingleTargetSpec $old_primary_host,
Peadm::SingleTargetSpec $new_primary_host,
Optional[String] $upgrade_version = undef,
) {
peadm::assert_supported_bolt_version()

Expand Down Expand Up @@ -40,4 +43,12 @@
restore_type => 'migration',
input_file => $remote_backup_path,
})

if $upgrade_version {
run_plan('peadm::upgrade', {
primary_host => $new_primary_host,
version => $upgrade_version,
download_mode => 'direct',
})
}
}

0 comments on commit b5c3cfb

Please # to comment.