diff --git a/definitions/scenarios/satellite_upgrade.rb b/definitions/scenarios/satellite_upgrade.rb index 3bf91f353..252c789b2 100644 --- a/definitions/scenarios/satellite_upgrade.rb +++ b/definitions/scenarios/satellite_upgrade.rb @@ -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 @@ -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 @@ -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 @@ -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) add_step(Procedures::Repositories::IndexKatelloRepositoriesContainerMetatdata)