foreman_maintain 0.6.16 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/definitions/checks/package_manager/yum/validate_yum_config.rb +51 -0
- data/definitions/features/candlepin.rb +0 -4
- data/definitions/features/dynflow_sidekiq.rb +4 -7
- data/definitions/features/pulpcore.rb +23 -6
- data/definitions/procedures/backup/accessibility_confirmation.rb +1 -1
- data/definitions/procedures/backup/online/safety_confirmation.rb +1 -1
- data/definitions/procedures/backup/snapshot/logical_volume_confirmation.rb +1 -1
- data/definitions/procedures/content/migration_stats.rb +12 -0
- data/definitions/procedures/content/prepare.rb +0 -5
- data/definitions/procedures/content/prepare_abort.rb +12 -0
- data/definitions/procedures/content/switchover.rb +1 -1
- data/definitions/procedures/packages/installer_confirmation.rb +1 -1
- data/definitions/procedures/packages/update_all_confirmation.rb +1 -1
- data/definitions/procedures/prep_6_10_upgrade.rb +31 -0
- data/definitions/procedures/restore/confirmation.rb +1 -1
- data/definitions/procedures/restore/installer_reset.rb +10 -1
- data/definitions/procedures/service/list.rb +2 -12
- data/definitions/scenarios/content.rb +50 -3
- data/definitions/scenarios/prep_6_10_upgrade.rb +13 -0
- data/definitions/scenarios/upgrade_to_capsule_6_9.rb +88 -0
- data/definitions/scenarios/upgrade_to_capsule_6_9_z.rb +88 -0
- data/definitions/scenarios/upgrade_to_satellite_6_9.rb +90 -0
- data/definitions/scenarios/upgrade_to_satellite_6_9_z.rb +89 -0
- data/lib/foreman_maintain.rb +1 -3
- data/lib/foreman_maintain/cli.rb +9 -0
- data/lib/foreman_maintain/cli/content_command.rb +17 -2
- data/lib/foreman_maintain/cli/upgrade_command.rb +0 -3
- data/lib/foreman_maintain/concerns/downstream.rb +4 -0
- data/lib/foreman_maintain/reporter.rb +18 -13
- data/lib/foreman_maintain/reporter/cli_reporter.rb +18 -9
- data/lib/foreman_maintain/runner.rb +6 -4
- data/lib/foreman_maintain/scenario.rb +4 -0
- data/lib/foreman_maintain/utils/disk/io_device.rb +0 -4
- data/lib/foreman_maintain/utils/service/systemd.rb +12 -3
- data/lib/foreman_maintain/version.rb +1 -1
- metadata +11 -5
- data/definitions/checks/disk/available_space_candlepin.rb +0 -27
- data/definitions/checks/yum_exclude.rb +0 -21
- data/lib/foreman_maintain/concerns/primary_checks.rb +0 -23
@@ -0,0 +1,88 @@
|
|
1
|
+
module Scenarios::Capsule_6_9
|
2
|
+
class Abstract < ForemanMaintain::Scenario
|
3
|
+
def self.upgrade_metadata(&block)
|
4
|
+
metadata do
|
5
|
+
tags :upgrade_scenario
|
6
|
+
confine do
|
7
|
+
feature(:capsule) &&
|
8
|
+
(feature(:capsule).current_minor_version == '6.8' || \
|
9
|
+
ForemanMaintain.upgrade_in_progress == '6.9')
|
10
|
+
end
|
11
|
+
instance_eval(&block)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def target_version
|
16
|
+
'6.9'
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
class PreUpgradeCheck < Abstract
|
21
|
+
upgrade_metadata do
|
22
|
+
description 'Checks before upgrading to Capsule 6.9'
|
23
|
+
tags :pre_upgrade_checks
|
24
|
+
run_strategy :fail_slow
|
25
|
+
end
|
26
|
+
|
27
|
+
def compose
|
28
|
+
add_steps(find_checks(:default))
|
29
|
+
add_steps(find_checks(:pre_upgrade))
|
30
|
+
add_step(Checks::Repositories::Validate.new(:version => '6.9'))
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
class PreMigrations < Abstract
|
35
|
+
upgrade_metadata do
|
36
|
+
description 'Procedures before migrating to Capsule 6.9'
|
37
|
+
tags :pre_migrations
|
38
|
+
end
|
39
|
+
|
40
|
+
def compose
|
41
|
+
add_steps(find_procedures(:pre_migrations))
|
42
|
+
add_step(Procedures::Service::Stop.new)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
class Migrations < Abstract
|
47
|
+
upgrade_metadata do
|
48
|
+
description 'Migration scripts to Capsule 6.9'
|
49
|
+
tags :migrations
|
50
|
+
end
|
51
|
+
|
52
|
+
def set_context_mapping
|
53
|
+
context.map(:assumeyes, Procedures::Installer::Upgrade => :assumeyes)
|
54
|
+
end
|
55
|
+
|
56
|
+
def compose
|
57
|
+
add_step(Procedures::Repositories::Setup.new(:version => '6.9'))
|
58
|
+
add_step(Procedures::Packages::UnlockVersions.new)
|
59
|
+
add_step(Procedures::Packages::Update.new(:assumeyes => true))
|
60
|
+
add_step_with_context(Procedures::Installer::Upgrade)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
class PostMigrations < Abstract
|
65
|
+
upgrade_metadata do
|
66
|
+
description 'Procedures after migrating to Capsule 6.9'
|
67
|
+
tags :post_migrations
|
68
|
+
end
|
69
|
+
|
70
|
+
def compose
|
71
|
+
add_step(Procedures::Service::Start.new)
|
72
|
+
add_steps(find_procedures(:post_migrations))
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
class PostUpgradeChecks < Abstract
|
77
|
+
upgrade_metadata do
|
78
|
+
description 'Checks after upgrading to Capsule 6.9'
|
79
|
+
tags :post_upgrade_checks
|
80
|
+
run_strategy :fail_slow
|
81
|
+
end
|
82
|
+
|
83
|
+
def compose
|
84
|
+
add_steps(find_checks(:default))
|
85
|
+
add_steps(find_checks(:post_upgrade))
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
@@ -0,0 +1,88 @@
|
|
1
|
+
module Scenarios::Capsule_6_9_z
|
2
|
+
class Abstract < ForemanMaintain::Scenario
|
3
|
+
def self.upgrade_metadata(&block)
|
4
|
+
metadata do
|
5
|
+
tags :upgrade_scenario
|
6
|
+
confine do
|
7
|
+
feature(:capsule) &&
|
8
|
+
(feature(:capsule).current_minor_version == '6.9' || \
|
9
|
+
ForemanMaintain.upgrade_in_progress == '6.9.z')
|
10
|
+
end
|
11
|
+
instance_eval(&block)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def target_version
|
16
|
+
'6.9.z'
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
class PreUpgradeCheck < Abstract
|
21
|
+
upgrade_metadata do
|
22
|
+
description 'Checks before upgrading to Capsule 6.9.z'
|
23
|
+
tags :pre_upgrade_checks
|
24
|
+
run_strategy :fail_slow
|
25
|
+
end
|
26
|
+
|
27
|
+
def compose
|
28
|
+
add_steps(find_checks(:default))
|
29
|
+
add_steps(find_checks(:pre_upgrade))
|
30
|
+
add_step(Checks::Repositories::Validate.new(:version => '6.9'))
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
class PreMigrations < Abstract
|
35
|
+
upgrade_metadata do
|
36
|
+
description 'Procedures before migrating to Capsule 6.9.z'
|
37
|
+
tags :pre_migrations
|
38
|
+
end
|
39
|
+
|
40
|
+
def compose
|
41
|
+
add_steps(find_procedures(:pre_migrations))
|
42
|
+
add_step(Procedures::Service::Stop.new)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
class Migrations < Abstract
|
47
|
+
upgrade_metadata do
|
48
|
+
description 'Migration scripts to Capsule 6.9.z'
|
49
|
+
tags :migrations
|
50
|
+
end
|
51
|
+
|
52
|
+
def set_context_mapping
|
53
|
+
context.map(:assumeyes, Procedures::Installer::Upgrade => :assumeyes)
|
54
|
+
end
|
55
|
+
|
56
|
+
def compose
|
57
|
+
add_step(Procedures::Repositories::Setup.new(:version => '6.9'))
|
58
|
+
add_step(Procedures::Packages::UnlockVersions.new)
|
59
|
+
add_step(Procedures::Packages::Update.new(:assumeyes => true))
|
60
|
+
add_step_with_context(Procedures::Installer::Upgrade)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
class PostMigrations < Abstract
|
65
|
+
upgrade_metadata do
|
66
|
+
description 'Procedures after migrating to Capsule 6.9.z'
|
67
|
+
tags :post_migrations
|
68
|
+
end
|
69
|
+
|
70
|
+
def compose
|
71
|
+
add_step(Procedures::Service::Start.new)
|
72
|
+
add_steps(find_procedures(:post_migrations))
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
class PostUpgradeChecks < Abstract
|
77
|
+
upgrade_metadata do
|
78
|
+
description 'Checks after upgrading to Capsule 6.9.z'
|
79
|
+
tags :post_upgrade_checks
|
80
|
+
run_strategy :fail_slow
|
81
|
+
end
|
82
|
+
|
83
|
+
def compose
|
84
|
+
add_steps(find_checks(:default))
|
85
|
+
add_steps(find_checks(:post_upgrade))
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
@@ -0,0 +1,90 @@
|
|
1
|
+
module Scenarios::Satellite_6_9
|
2
|
+
class Abstract < ForemanMaintain::Scenario
|
3
|
+
def self.upgrade_metadata(&block)
|
4
|
+
metadata do
|
5
|
+
tags :upgrade_scenario
|
6
|
+
confine do
|
7
|
+
feature(:satellite) &&
|
8
|
+
(feature(:satellite).current_minor_version == '6.8' || \
|
9
|
+
ForemanMaintain.upgrade_in_progress == '6.9')
|
10
|
+
end
|
11
|
+
instance_eval(&block)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def target_version
|
16
|
+
'6.9'
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
class PreUpgradeCheck < Abstract
|
21
|
+
upgrade_metadata do
|
22
|
+
description 'Checks before upgrading to Satellite 6.9'
|
23
|
+
tags :pre_upgrade_checks
|
24
|
+
run_strategy :fail_slow
|
25
|
+
end
|
26
|
+
|
27
|
+
def compose
|
28
|
+
add_steps(find_checks(:default))
|
29
|
+
add_steps(find_checks(:pre_upgrade))
|
30
|
+
add_step(Checks::Foreman::CheckpointSegments)
|
31
|
+
add_step(Checks::Repositories::Validate.new(:version => '6.9'))
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
class PreMigrations < Abstract
|
36
|
+
upgrade_metadata do
|
37
|
+
description 'Procedures before migrating to Satellite 6.9'
|
38
|
+
tags :pre_migrations
|
39
|
+
end
|
40
|
+
|
41
|
+
def compose
|
42
|
+
add_steps(find_procedures(:pre_migrations))
|
43
|
+
add_step(Procedures::Service::Stop.new)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
class Migrations < Abstract
|
48
|
+
upgrade_metadata do
|
49
|
+
description 'Migration scripts to Satellite 6.9'
|
50
|
+
tags :migrations
|
51
|
+
end
|
52
|
+
|
53
|
+
def set_context_mapping
|
54
|
+
context.map(:assumeyes, Procedures::Installer::Upgrade => :assumeyes)
|
55
|
+
end
|
56
|
+
|
57
|
+
def compose
|
58
|
+
add_step(Procedures::Repositories::Setup.new(:version => '6.9'))
|
59
|
+
add_step(Procedures::Packages::UnlockVersions.new)
|
60
|
+
add_step(Procedures::Packages::Update.new(:assumeyes => true))
|
61
|
+
add_step_with_context(Procedures::Installer::Upgrade)
|
62
|
+
add_step(Procedures::Installer::UpgradeRakeTask)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
class PostMigrations < Abstract
|
67
|
+
upgrade_metadata do
|
68
|
+
description 'Procedures after migrating to Satellite 6.9'
|
69
|
+
tags :post_migrations
|
70
|
+
end
|
71
|
+
|
72
|
+
def compose
|
73
|
+
add_step(Procedures::Service::Start.new)
|
74
|
+
add_steps(find_procedures(:post_migrations))
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
class PostUpgradeChecks < Abstract
|
79
|
+
upgrade_metadata do
|
80
|
+
description 'Checks after upgrading to Satellite 6.9'
|
81
|
+
tags :post_upgrade_checks
|
82
|
+
run_strategy :fail_slow
|
83
|
+
end
|
84
|
+
|
85
|
+
def compose
|
86
|
+
add_steps(find_checks(:default))
|
87
|
+
add_steps(find_checks(:post_upgrade))
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
@@ -0,0 +1,89 @@
|
|
1
|
+
module Scenarios::Satellite_6_9_z
|
2
|
+
class Abstract < ForemanMaintain::Scenario
|
3
|
+
def self.upgrade_metadata(&block)
|
4
|
+
metadata do
|
5
|
+
tags :upgrade_scenario
|
6
|
+
confine do
|
7
|
+
feature(:satellite) &&
|
8
|
+
(feature(:satellite).current_minor_version == '6.9' || \
|
9
|
+
ForemanMaintain.upgrade_in_progress == '6.9.z')
|
10
|
+
end
|
11
|
+
instance_eval(&block)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def target_version
|
16
|
+
'6.9.z'
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
class PreUpgradeCheck < Abstract
|
21
|
+
upgrade_metadata do
|
22
|
+
description 'Checks before upgrading to Satellite 6.9.z'
|
23
|
+
tags :pre_upgrade_checks
|
24
|
+
run_strategy :fail_slow
|
25
|
+
end
|
26
|
+
|
27
|
+
def compose
|
28
|
+
add_steps(find_checks(:default))
|
29
|
+
add_steps(find_checks(:pre_upgrade))
|
30
|
+
add_step(Checks::Repositories::Validate.new(:version => '6.9'))
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
class PreMigrations < Abstract
|
35
|
+
upgrade_metadata do
|
36
|
+
description 'Procedures before migrating to Satellite 6.9.z'
|
37
|
+
tags :pre_migrations
|
38
|
+
end
|
39
|
+
|
40
|
+
def compose
|
41
|
+
add_steps(find_procedures(:pre_migrations))
|
42
|
+
add_step(Procedures::Service::Stop.new)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
class Migrations < Abstract
|
47
|
+
upgrade_metadata do
|
48
|
+
description 'Migration scripts to Satellite 6.9.z'
|
49
|
+
tags :migrations
|
50
|
+
end
|
51
|
+
|
52
|
+
def set_context_mapping
|
53
|
+
context.map(:assumeyes, Procedures::Installer::Upgrade => :assumeyes)
|
54
|
+
end
|
55
|
+
|
56
|
+
def compose
|
57
|
+
add_step(Procedures::Repositories::Setup.new(:version => '6.9'))
|
58
|
+
add_step(Procedures::Packages::UnlockVersions.new)
|
59
|
+
add_step(Procedures::Packages::Update.new(:assumeyes => true))
|
60
|
+
add_step_with_context(Procedures::Installer::Upgrade)
|
61
|
+
add_step(Procedures::Installer::UpgradeRakeTask)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
class PostMigrations < Abstract
|
66
|
+
upgrade_metadata do
|
67
|
+
description 'Procedures after migrating to Satellite 6.9.z'
|
68
|
+
tags :post_migrations
|
69
|
+
end
|
70
|
+
|
71
|
+
def compose
|
72
|
+
add_step(Procedures::Service::Start.new)
|
73
|
+
add_steps(find_procedures(:post_migrations))
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
class PostUpgradeChecks < Abstract
|
78
|
+
upgrade_metadata do
|
79
|
+
description 'Checks after upgrading to Satellite 6.9.z'
|
80
|
+
tags :post_upgrade_checks
|
81
|
+
run_strategy :fail_slow
|
82
|
+
end
|
83
|
+
|
84
|
+
def compose
|
85
|
+
add_steps(find_checks(:default))
|
86
|
+
add_steps(find_checks(:post_upgrade))
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
data/lib/foreman_maintain.rb
CHANGED
@@ -21,7 +21,6 @@ module ForemanMaintain
|
|
21
21
|
require 'foreman_maintain/concerns/base_database'
|
22
22
|
require 'foreman_maintain/concerns/directory_marker'
|
23
23
|
require 'foreman_maintain/concerns/downstream'
|
24
|
-
require 'foreman_maintain/concerns/primary_checks'
|
25
24
|
require 'foreman_maintain/top_level_modules'
|
26
25
|
require 'foreman_maintain/yaml_storage'
|
27
26
|
require 'foreman_maintain/config'
|
@@ -42,7 +41,6 @@ module ForemanMaintain
|
|
42
41
|
require 'foreman_maintain/error'
|
43
42
|
|
44
43
|
class << self
|
45
|
-
include ForemanMaintain::Concerns::PrimaryChecks
|
46
44
|
attr_accessor :config, :logger
|
47
45
|
|
48
46
|
LOGGER_LEVEL_MAPPING = {
|
@@ -155,7 +153,7 @@ module ForemanMaintain
|
|
155
153
|
def pkg_and_cmd_name
|
156
154
|
instance_feature = ForemanMaintain.available_features(:label => :instance).first
|
157
155
|
if instance_feature.downstream
|
158
|
-
return
|
156
|
+
return instance_feature.downstream.fm_pkg_and_cmd_name
|
159
157
|
end
|
160
158
|
|
161
159
|
[main_package_name, 'foreman-maintain']
|
data/lib/foreman_maintain/cli.rb
CHANGED
@@ -27,6 +27,15 @@ module ForemanMaintain
|
|
27
27
|
subcommand 'content', 'Content related commands', ContentCommand
|
28
28
|
subcommand 'maintenance-mode', 'Control maintenance-mode for application',
|
29
29
|
MaintenanceModeCommand
|
30
|
+
if ::Scenarios.const_defined?('Satellite_6_10') &&
|
31
|
+
ForemanMaintain.detector.feature('satellite') &&
|
32
|
+
ForemanMaintain.detector.feature('satellite').current_minor_version == '6.9'
|
33
|
+
subcommand 'prep-6.10-upgrade', 'Preparations for the Satellite 6.10 upgrade' do
|
34
|
+
def execute
|
35
|
+
run_scenarios_and_exit(Scenarios::Prep610Upgrade.new)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
30
39
|
|
31
40
|
def run(*arguments)
|
32
41
|
logger.info("Running foreman-maintain command with arguments #{arguments.inspect}")
|
@@ -7,9 +7,24 @@ module ForemanMaintain
|
|
7
7
|
end
|
8
8
|
end
|
9
9
|
|
10
|
-
|
10
|
+
unless ForemanMaintain.detector.feature(:satellite) ||
|
11
|
+
ForemanMaintain.detector.feature(:capsule)
|
12
|
+
subcommand 'switchover', 'Switch support for certain content from Pulp 2 to Pulp 3' do
|
13
|
+
def execute
|
14
|
+
run_scenarios_and_exit(Scenarios::Content::Switchover.new)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
subcommand 'prepare-abort', 'Abort all running Pulp 2 to Pulp 3 migration tasks' do
|
20
|
+
def execute
|
21
|
+
run_scenarios_and_exit(Scenarios::Content::PrepareAbort.new)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
subcommand 'migration-stats', 'Retrieve Pulp 2 to Pulp 3 migration statistics' do
|
11
26
|
def execute
|
12
|
-
run_scenarios_and_exit(Scenarios::Content::
|
27
|
+
run_scenarios_and_exit(Scenarios::Content::MigrationStats.new)
|
13
28
|
end
|
14
29
|
end
|
15
30
|
end
|
@@ -56,7 +56,6 @@ module ForemanMaintain
|
|
56
56
|
disable_self_upgrade_option
|
57
57
|
|
58
58
|
def execute
|
59
|
-
ForemanMaintain.validate_downstream_packages
|
60
59
|
ForemanMaintain.perform_self_upgrade unless disable_self_upgrade?
|
61
60
|
print_versions(UpgradeRunner.available_targets)
|
62
61
|
end
|
@@ -68,7 +67,6 @@ module ForemanMaintain
|
|
68
67
|
disable_self_upgrade_option
|
69
68
|
|
70
69
|
def execute
|
71
|
-
ForemanMaintain.validate_downstream_packages
|
72
70
|
ForemanMaintain.perform_self_upgrade unless disable_self_upgrade?
|
73
71
|
upgrade_runner.run_phase(:pre_upgrade_checks)
|
74
72
|
exit upgrade_runner.exit_code
|
@@ -88,7 +86,6 @@ module ForemanMaintain
|
|
88
86
|
end
|
89
87
|
|
90
88
|
def execute
|
91
|
-
ForemanMaintain.validate_downstream_packages
|
92
89
|
ForemanMaintain.perform_self_upgrade unless disable_self_upgrade?
|
93
90
|
if phase
|
94
91
|
upgrade_runner.run_phase(phase.to_sym)
|