Skip to content

Commit

Permalink
Add 6.15 upgrade scenarios
Browse files Browse the repository at this point in the history
  • Loading branch information
ehelms committed Aug 15, 2023
1 parent fd5b2d5 commit 5b70e21
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 43 deletions.
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
module Scenarios::Capsule_6_14_z
module Scenarios::Capsule_6_15
class Abstract < ForemanMaintain::Scenario
def self.upgrade_metadata(&block)
metadata do
tags :upgrade_scenario
confine do
feature(:capsule) &&
(feature(:capsule).current_minor_version == '6.14' || \
ForemanMaintain.upgrade_in_progress == '6.14.z')
ForemanMaintain.upgrade_in_progress == '6.15')
end
instance_eval(&block)
end
end

def target_version
'6.14.z'
'6.15'
end
end

class PreUpgradeCheck < Abstract
upgrade_metadata do
description 'Checks before upgrading to Capsule 6.14.z'
description 'Checks before upgrading to Capsule 6.15'
tags :pre_upgrade_checks
run_strategy :fail_slow
end
Expand All @@ -28,13 +28,13 @@ def compose
add_steps(find_checks(:default))
add_steps(find_checks(:pre_upgrade))
add_step(Checks::Foreman::CheckpointSegments)
add_step(Checks::Repositories::Validate.new(:version => '6.14'))
add_step(Checks::Repositories::Validate.new(:version => '6.15'))
end
end

class PreMigrations < Abstract
upgrade_metadata do
description 'Procedures before migrating to Capsule 6.14.z'
description 'Procedures before migrating to Capsule 6.15'
tags :pre_migrations
end

Expand All @@ -45,7 +45,7 @@ def compose

class Migrations < Abstract
upgrade_metadata do
description 'Migration scripts to Capsule 6.14.z'
description 'Migration scripts to Capsule 6.15'
tags :migrations
end

Expand All @@ -54,7 +54,7 @@ def set_context_mapping
end

def compose
add_step(Procedures::Repositories::Setup.new(:version => '6.14'))
add_step(Procedures::Repositories::Setup.new(:version => '6.15'))
modules_to_enable = ["satellite-capsule:#{el_short_name}"]
add_step(Procedures::Packages::EnableModules.new(:module_names => modules_to_enable))
add_step(Procedures::Packages::Update.new(:assumeyes => true,
Expand All @@ -67,7 +67,7 @@ def compose

class PostMigrations < Abstract
upgrade_metadata do
description 'Procedures after migrating to Capsule 6.14.z'
description 'Procedures after migrating to Capsule 6.15'
tags :post_migrations
end

Expand All @@ -80,7 +80,7 @@ def compose

class PostUpgradeChecks < Abstract
upgrade_metadata do
description 'Checks after upgrading to Capsule 6.14.z'
description 'Checks after upgrading to Capsule 6.15'
tags :post_upgrade_checks
run_strategy :fail_slow
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
module Scenarios::Capsule_6_14
module Scenarios::Capsule_6_15_z
class Abstract < ForemanMaintain::Scenario
def self.upgrade_metadata(&block)
metadata do
tags :upgrade_scenario
confine do
feature(:capsule) &&
(feature(:capsule).current_minor_version == '6.13' || \
ForemanMaintain.upgrade_in_progress == '6.14')
(feature(:capsule).current_minor_version == '6.15' || \
ForemanMaintain.upgrade_in_progress == '6.15.z')
end
instance_eval(&block)
end
end

def target_version
'6.14'
'6.15.z'
end
end

class PreUpgradeCheck < Abstract
upgrade_metadata do
description 'Checks before upgrading to Capsule 6.14'
description 'Checks before upgrading to Capsule 6.15.z'
tags :pre_upgrade_checks
run_strategy :fail_slow
end
Expand All @@ -28,13 +28,13 @@ def compose
add_steps(find_checks(:default))
add_steps(find_checks(:pre_upgrade))
add_step(Checks::Foreman::CheckpointSegments)
add_step(Checks::Repositories::Validate.new(:version => '6.14'))
add_step(Checks::Repositories::Validate.new(:version => '6.15'))
end
end

class PreMigrations < Abstract
upgrade_metadata do
description 'Procedures before migrating to Capsule 6.14'
description 'Procedures before migrating to Capsule 6.15.z'
tags :pre_migrations
end

Expand All @@ -45,7 +45,7 @@ def compose

class Migrations < Abstract
upgrade_metadata do
description 'Migration scripts to Capsule 6.14'
description 'Migration scripts to Capsule 6.15.z'
tags :migrations
end

Expand All @@ -54,7 +54,7 @@ def set_context_mapping
end

def compose
add_step(Procedures::Repositories::Setup.new(:version => '6.14'))
add_step(Procedures::Repositories::Setup.new(:version => '6.15'))
modules_to_enable = ["satellite-capsule:#{el_short_name}"]
add_step(Procedures::Packages::EnableModules.new(:module_names => modules_to_enable))
add_step(Procedures::Packages::Update.new(:assumeyes => true,
Expand All @@ -67,7 +67,7 @@ def compose

class PostMigrations < Abstract
upgrade_metadata do
description 'Procedures after migrating to Capsule 6.14'
description 'Procedures after migrating to Capsule 6.15.z'
tags :post_migrations
end

Expand All @@ -80,7 +80,7 @@ def compose

class PostUpgradeChecks < Abstract
upgrade_metadata do
description 'Checks after upgrading to Capsule 6.14'
description 'Checks after upgrading to Capsule 6.15.z'
tags :post_upgrade_checks
run_strategy :fail_slow
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
module Scenarios::Satellite_6_14_z
module Scenarios::Satellite_6_15
class Abstract < ForemanMaintain::Scenario
def self.upgrade_metadata(&block)
metadata do
tags :upgrade_scenario
confine do
feature(:satellite) &&
(feature(:satellite).current_minor_version == '6.14' || \
ForemanMaintain.upgrade_in_progress == '6.14.z')
ForemanMaintain.upgrade_in_progress == '6.15')
end
instance_eval(&block)
end
end

def target_version
'6.14.z'
'6.15'
end
end

class PreUpgradeCheck < Abstract
upgrade_metadata do
description 'Checks before upgrading to Satellite 6.14.z'
description 'Checks before upgrading to Satellite 6.15'
tags :pre_upgrade_checks
run_strategy :fail_slow
end
Expand All @@ -28,13 +28,13 @@ def compose
add_steps(find_checks(:default))
add_steps(find_checks(:pre_upgrade))
add_step(Checks::Foreman::CheckpointSegments)
add_step(Checks::Repositories::Validate.new(:version => '6.14'))
add_step(Checks::Repositories::Validate.new(:version => '6.15'))
end
end

class PreMigrations < Abstract
upgrade_metadata do
description 'Procedures before migrating to Satellite 6.14.z'
description 'Procedures before migrating to Satellite 6.15'
tags :pre_migrations
end

Expand All @@ -45,16 +45,17 @@ def compose

class Migrations < Abstract
upgrade_metadata do
description 'Migration scripts to Satellite 6.14.z'
description 'Migration scripts to Satellite 6.15'
tags :migrations
run_strategy :fail_fast
end

def set_context_mapping
context.map(:assumeyes, Procedures::Installer::Upgrade => :assumeyes)
end

def compose
add_step(Procedures::Repositories::Setup.new(:version => '6.14'))
add_step(Procedures::Repositories::Setup.new(:version => '6.15'))
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,
Expand All @@ -68,7 +69,7 @@ def compose

class PostMigrations < Abstract
upgrade_metadata do
description 'Procedures after migrating to Satellite 6.14.z'
description 'Procedures after migrating to Satellite 6.15'
tags :post_migrations
end

Expand All @@ -81,7 +82,7 @@ def compose

class PostUpgradeChecks < Abstract
upgrade_metadata do
description 'Checks after upgrading to Satellite 6.14.z'
description 'Checks after upgrading to Satellite 6.15'
tags :post_upgrade_checks
run_strategy :fail_slow
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
module Scenarios::Satellite_6_14
module Scenarios::Satellite_6_15_z
class Abstract < ForemanMaintain::Scenario
def self.upgrade_metadata(&block)
metadata do
tags :upgrade_scenario
confine do
feature(:satellite) &&
(feature(:satellite).current_minor_version == '6.13' || \
ForemanMaintain.upgrade_in_progress == '6.14')
(feature(:satellite).current_minor_version == '6.15' || \
ForemanMaintain.upgrade_in_progress == '6.15.z')
end
instance_eval(&block)
end
end

def target_version
'6.14'
'6.15.z'
end
end

class PreUpgradeCheck < Abstract
upgrade_metadata do
description 'Checks before upgrading to Satellite 6.14'
description 'Checks before upgrading to Satellite 6.15.z'
tags :pre_upgrade_checks
run_strategy :fail_slow
end
Expand All @@ -28,13 +28,13 @@ def compose
add_steps(find_checks(:default))
add_steps(find_checks(:pre_upgrade))
add_step(Checks::Foreman::CheckpointSegments)
add_step(Checks::Repositories::Validate.new(:version => '6.14'))
add_step(Checks::Repositories::Validate.new(:version => '6.15'))
end
end

class PreMigrations < Abstract
upgrade_metadata do
description 'Procedures before migrating to Satellite 6.14'
description 'Procedures before migrating to Satellite 6.15.z'
tags :pre_migrations
end

Expand All @@ -45,17 +45,16 @@ def compose

class Migrations < Abstract
upgrade_metadata do
description 'Migration scripts to Satellite 6.14'
description 'Migration scripts to Satellite 6.15.z'
tags :migrations
run_strategy :fail_fast
end

def set_context_mapping
context.map(:assumeyes, Procedures::Installer::Upgrade => :assumeyes)
end

def compose
add_step(Procedures::Repositories::Setup.new(:version => '6.14'))
add_step(Procedures::Repositories::Setup.new(:version => '6.15'))
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,
Expand All @@ -69,7 +68,7 @@ def compose

class PostMigrations < Abstract
upgrade_metadata do
description 'Procedures after migrating to Satellite 6.14'
description 'Procedures after migrating to Satellite 6.15.z'
tags :post_migrations
end

Expand All @@ -82,7 +81,7 @@ def compose

class PostUpgradeChecks < Abstract
upgrade_metadata do
description 'Checks after upgrading to Satellite 6.14'
description 'Checks after upgrading to Satellite 6.15.z'
tags :post_upgrade_checks
run_strategy :fail_slow
end
Expand Down

0 comments on commit 5b70e21

Please sign in to comment.