Skip to content

Commit

Permalink
Fixes #37158: Explicitly define upgrade steps in upgrade scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
ehelms committed Jun 11, 2024
1 parent 891529b commit 60304ed
Showing 1 changed file with 55 additions and 7 deletions.
62 changes: 55 additions & 7 deletions definitions/scenarios/satellite_upgrade.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,43 @@ class PreUpgradeCheck < Abstract
run_strategy :fail_slow
end

# rubocop:disable Metrics/MethodLength, Metrics/AbcSize
def compose
add_steps(find_checks(:default))
add_steps(find_checks(:pre_upgrade))
add_steps(
Checks::Foreman::FactsNames.new, # if Foreman database present
Checks::ForemanProxy::CheckTftpStorage.new, # if Satellite with foreman-proxy+tftp
Checks::ForemanProxy::VerifyDhcpConfigSyntax.new, # if foreman-proxy+dhcp-isc
Checks::ForemanTasks::NotPaused.new, # if foreman-tasks present
Checks::Puppet::VerifyNoEmptyCacertRequests.new, # if puppetserver
Checks::ServerPing.new,
Checks::ServicesUp.new,
Checks::SystemRegistration.new
)
add_steps(
Checks::CheckHotfixInstalled.new,
Checks::CheckTmout.new,
Checks::CheckUpstreamRepository.new,
Checks::Disk::AvailableSpace.new,
Checks::Disk::AvailableSpaceCandlepin.new, # if candlepin
Checks::Foreman::ValidateExternalDbVersion.new, # if external database
Checks::Foreman::CheckCorruptedRoles.new,
Checks::Foreman::CheckDuplicatePermissions.new,
Checks::Foreman::TuningRequirements.new, # if katello present
Checks::ForemanOpenscap::InvalidReportAssociations.new, # if foreman-openscap
Checks::ForemanTasks::Invalid::CheckOld.new, # if foreman-tasks
Checks::ForemanTasks::Invalid::CheckPendingState.new, # if foreman-tasks
Checks::ForemanTasks::Invalid::CheckPlanningState.new, # if foreman-tasks
Checks::ForemanTasks::NotRunning.new, # if foreman-tasks
Checks::NonRhPackages.new,
Checks::PackageManager::Dnf::ValidateDnfConfig.new,
Checks::Repositories::CheckNonRhRepository.new
)
add_step(Checks::CheckIpv6Disable)
add_step(Checks::Disk::AvailableSpacePostgresql13)
add_step(Checks::Repositories::Validate.new(:version => target_version))
add_step(Checks::CheckOrganizationContentAccessMode)
end
# rubocop:enable Metrics/MethodLength, Metrics/AbcSize
end

class PreMigrations < Abstract
Expand All @@ -40,7 +69,16 @@ class PreMigrations < Abstract
end

def compose
add_steps(find_procedures(:pre_migrations))
add_step(Procedures::Repositories::Setup.new(:version => target_version))
modules_to_enable = ["satellite:#{el_short_name}"]
add_step(Procedures::Packages::EnableModules.new(:module_names => modules_to_enable))
add_step(Procedures::Packages::Update.new(
:assumeyes => true,
:dnf_options => ['--downloadonly']
))
add_step(Procedures::MaintenanceMode::EnableMaintenanceMode.new)
add_step(Procedures::Crond::Stop.new)
add_step(Procedures::SyncPlans::Disable.new)
end
end

Expand Down Expand Up @@ -81,9 +119,11 @@ class PostMigrations < Abstract
end

def compose
add_step(Procedures::RefreshFeatures)
add_step(Procedures::RefreshFeatures.new)
add_step(Procedures::Service::Start.new)
add_steps(find_procedures(:post_migrations))
add_step(Procedures::Crond::Start.new)
add_step(Procedures::SyncPlans::Enable.new)
add_step(Procedures::MaintenanceMode::DisableMaintenanceMode.new)
end
end

Expand All @@ -95,8 +135,16 @@ class PostUpgradeChecks < Abstract
end

def compose
add_steps(find_checks(:default))
add_steps(find_checks(:post_upgrade))
add_steps(
Checks::Foreman::FactsNames.new, # if Foreman database present
Checks::ForemanProxy::CheckTftpStorage.new, # if Satellite with foreman-proxy+tftp
Checks::ForemanProxy::VerifyDhcpConfigSyntax.new, # if foreman-proxy+dhcp-isc
Checks::ForemanTasks::NotPaused.new, # if foreman-tasks present
Checks::Puppet::VerifyNoEmptyCacertRequests.new, # if puppetserver
Checks::ServerPing.new,
Checks::ServicesUp.new,
Checks::SystemRegistration.new
)
add_step(Procedures::Packages::CheckForReboot)
add_step(Procedures::Pulpcore::ContainerHandleImageMetadata)
end
Expand Down

0 comments on commit 60304ed

Please sign in to comment.