Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single target version #879

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions definitions/scenarios/foreman_upgrade.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def self.upgrade_metadata(&block)
end

def target_version
'nightly'
feature(:instance).target_version
end
end

Expand Down Expand Up @@ -83,7 +83,7 @@ def set_context_mapping
end

def compose
add_step(Procedures::Repositories::Setup.new(:version => 'nightly'))
add_step(Procedures::Repositories::Setup.new(:version => target_version))
if el8?
modules_to_switch = ['postgresql:13']
add_step(Procedures::Packages::SwitchModules.new(:module_names => modules_to_switch))
Expand Down
66 changes: 57 additions & 9 deletions definitions/scenarios/satellite_upgrade.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ def self.upgrade_metadata(&block)
tags :upgrade_scenario
confine do
(feature(:downstream).current_minor_version == '6.15' || \
ForemanMaintain.upgrade_in_progress == '6.16')
ForemanMaintain.upgrade_in_progress == target_version)
end
instance_eval(&block)
end
end

def target_version
'6.16'
feature(:instance).target_version
end
end

Expand All @@ -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
Loading