foreman_maintain 0.6.10 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/definitions/checks/foreman/check_checkpoint_segments.rb +30 -22
- data/definitions/checks/package_manager/yum/validate_yum_config.rb +51 -0
- 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/installer/upgrade_rake_task.rb +11 -0
- 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/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_8.rb +1 -0
- data/definitions/scenarios/upgrade_to_satellite_6_8_z.rb +1 -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/extras/foreman_protector/foreman-protector.whitelist +1 -0
- data/lib/foreman_maintain.rb +1 -1
- data/lib/foreman_maintain/cli.rb +11 -2
- data/lib/foreman_maintain/cli/content_command.rb +17 -2
- 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/service/systemd.rb +11 -1
- data/lib/foreman_maintain/version.rb +1 -1
- metadata +12 -3
- data/definitions/checks/yum_exclude.rb +0 -21
@@ -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
|
@@ -59,6 +59,7 @@ module Scenarios::Satellite_6_8
|
|
59
59
|
add_step(Procedures::Packages::UnlockVersions.new)
|
60
60
|
add_step(Procedures::Packages::Update.new(:assumeyes => true))
|
61
61
|
add_step_with_context(Procedures::Installer::Upgrade)
|
62
|
+
add_step(Procedures::Installer::UpgradeRakeTask)
|
62
63
|
end
|
63
64
|
end
|
64
65
|
|
@@ -58,6 +58,7 @@ module Scenarios::Satellite_6_8_z
|
|
58
58
|
add_step(Procedures::Packages::UnlockVersions.new)
|
59
59
|
add_step(Procedures::Packages::Update.new(:assumeyes => true))
|
60
60
|
add_step_with_context(Procedures::Installer::Upgrade)
|
61
|
+
add_step(Procedures::Installer::UpgradeRakeTask)
|
61
62
|
end
|
62
63
|
end
|
63
64
|
|
@@ -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
@@ -153,7 +153,7 @@ module ForemanMaintain
|
|
153
153
|
def pkg_and_cmd_name
|
154
154
|
instance_feature = ForemanMaintain.available_features(:label => :instance).first
|
155
155
|
if instance_feature.downstream
|
156
|
-
return
|
156
|
+
return instance_feature.downstream.fm_pkg_and_cmd_name
|
157
157
|
end
|
158
158
|
|
159
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}")
|
@@ -57,7 +66,7 @@ module ForemanMaintain
|
|
57
66
|
raise error
|
58
67
|
end
|
59
68
|
|
60
|
-
puts error.message
|
69
|
+
$stderr.puts error.message
|
61
70
|
logger.error(error)
|
62
71
|
|
63
72
|
@exit_code = 1
|
@@ -65,7 +74,7 @@ module ForemanMaintain
|
|
65
74
|
|
66
75
|
def process_usage_error(error)
|
67
76
|
log_exit_code_info(1)
|
68
|
-
puts error.message
|
77
|
+
$stderr.puts error.message
|
69
78
|
exit!
|
70
79
|
end
|
71
80
|
end
|
@@ -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
|