foreman_maintain 1.6.6 → 1.6.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -5
  3. data/definitions/checks/check_ipv6_disable.rb +23 -0
  4. data/definitions/features/capsule.rb +1 -2
  5. data/definitions/features/dynflow_sidekiq.rb +1 -6
  6. data/definitions/features/foreman_install.rb +1 -1
  7. data/definitions/features/foreman_server.rb +0 -1
  8. data/definitions/features/foreman_tasks.rb +0 -8
  9. data/definitions/features/instance.rb +0 -1
  10. data/definitions/features/katello.rb +0 -15
  11. data/definitions/procedures/hammer_setup.rb +3 -0
  12. data/definitions/procedures/packages/update.rb +2 -2
  13. data/definitions/procedures/pulpcore/container_handle_image_metadata.rb +26 -0
  14. data/definitions/procedures/repositories/setup.rb +1 -1
  15. data/definitions/procedures/restore/configs.rb +0 -19
  16. data/definitions/procedures/restore/drop_databases.rb +1 -3
  17. data/definitions/procedures/restore/reindex_databases.rb +6 -0
  18. data/definitions/procedures/restore/required_packages.rb +0 -1
  19. data/definitions/scenarios/backup.rb +9 -20
  20. data/definitions/scenarios/foreman_upgrade.rb +142 -0
  21. data/definitions/scenarios/restore.rb +11 -29
  22. data/definitions/scenarios/self_upgrade.rb +1 -4
  23. data/definitions/scenarios/update.rb +2 -1
  24. data/definitions/scenarios/upgrade_to_capsule_6_16.rb +2 -0
  25. data/definitions/scenarios/upgrade_to_satellite_6_16.rb +2 -0
  26. data/lib/foreman_maintain/cli/update_command.rb +7 -5
  27. data/lib/foreman_maintain/cli/upgrade_command.rb +0 -10
  28. data/lib/foreman_maintain/concerns/base_database.rb +0 -6
  29. data/lib/foreman_maintain/concerns/system_helpers.rb +3 -3
  30. data/lib/foreman_maintain/package_manager/apt.rb +1 -1
  31. data/lib/foreman_maintain/package_manager/dnf.rb +10 -6
  32. data/lib/foreman_maintain/utils/backup.rb +2 -23
  33. data/lib/foreman_maintain/version.rb +1 -1
  34. metadata +5 -10
  35. data/definitions/features/gofer.rb +0 -16
  36. data/definitions/procedures/pulpcore/migrate.rb +0 -24
  37. data/definitions/procedures/restore/candlepin_reset_migrations.rb +0 -14
  38. data/definitions/procedures/selinux/set_file_security.rb +0 -25
  39. data/definitions/scenarios/upgrade_to_capsule_6_16_z.rb +0 -97
  40. data/definitions/scenarios/upgrade_to_foreman_nightly.rb +0 -91
  41. data/definitions/scenarios/upgrade_to_katello_nightly.rb +0 -96
  42. data/definitions/scenarios/upgrade_to_satellite_6_16_z.rb +0 -98
@@ -27,6 +27,7 @@ module Scenarios::Satellite_6_16
27
27
  def compose
28
28
  add_steps(find_checks(:default))
29
29
  add_steps(find_checks(:pre_upgrade))
30
+ add_step(Checks::CheckIpv6Disable)
30
31
  add_step(Checks::Disk::AvailableSpacePostgresql13)
31
32
  add_step(Checks::Repositories::Validate.new(:version => '6.16'))
32
33
  add_step(Checks::CheckOrganizationContentAccessMode)
@@ -98,6 +99,7 @@ module Scenarios::Satellite_6_16
98
99
  add_steps(find_checks(:default))
99
100
  add_steps(find_checks(:post_upgrade))
100
101
  add_step(Procedures::Packages::CheckForReboot)
102
+ add_step(Procedures::Pulpcore::ContainerHandleImageMetadata)
101
103
  end
102
104
  end
103
105
  end
@@ -26,8 +26,9 @@ module ForemanMaintain
26
26
  def execute
27
27
  ForemanMaintain.validate_downstream_packages
28
28
  ForemanMaintain.perform_self_upgrade unless disable_self_update?
29
- update_runner.run_phase(:pre_update_checks)
30
- exit update_runner.exit_code
29
+ runner = update_runner
30
+ runner.run_phase(:pre_update_checks)
31
+ exit runner.exit_code
31
32
  end
32
33
  end
33
34
 
@@ -38,9 +39,10 @@ module ForemanMaintain
38
39
  def execute
39
40
  ForemanMaintain.validate_downstream_packages
40
41
  ForemanMaintain.perform_self_upgrade unless disable_self_update?
41
- update_runner.run
42
- update_runner.save
43
- exit update_runner.exit_code
42
+ runner = update_runner
43
+ runner.run
44
+ runner.save
45
+ exit runner.exit_code
44
46
  end
45
47
  end
46
48
  end
@@ -56,16 +56,6 @@ module ForemanMaintain
56
56
  !disable_self_upgrade?
57
57
  end
58
58
 
59
- subcommand 'list-versions', 'List versions this system is upgradable to' do
60
- disable_self_upgrade_option
61
-
62
- def execute
63
- ForemanMaintain.validate_downstream_packages
64
- ForemanMaintain.perform_self_upgrade if allow_self_upgrade?
65
- print_versions(UpgradeRunner.available_targets)
66
- end
67
- end
68
-
69
59
  subcommand 'check', 'Run pre-upgrade checks before upgrading to specified version' do
70
60
  target_version_option
71
61
  interactive_option
@@ -41,12 +41,6 @@ module ForemanMaintain
41
41
  raise NotImplementedError
42
42
  end
43
43
 
44
- def config_files
45
- [
46
- '/etc/systemd/system/postgresql.service',
47
- ]
48
- end
49
-
50
44
  def local?(config = configuration)
51
45
  ['localhost', '127.0.0.1', `hostname`.strip].include? config['host']
52
46
  end
@@ -100,7 +100,7 @@ module ForemanMaintain
100
100
  end
101
101
 
102
102
  def packages_action(action, packages, options = {})
103
- options.validate_options!(:assumeyes, :options, :download_only)
103
+ options.validate_options!(:assumeyes, :options, :download_only, :enabled_repos)
104
104
  case action
105
105
  when :install
106
106
  package_manager.install(packages, :assumeyes => options[:assumeyes])
@@ -108,8 +108,8 @@ module ForemanMaintain
108
108
  package_manager.update(
109
109
  packages,
110
110
  :assumeyes => options[:assumeyes],
111
- :options => options[:options],
112
- :download_only => options[:download_only]
111
+ :download_only => options[:download_only],
112
+ :enabled_repos => options[:enabled_repos]
113
113
  )
114
114
  when :remove
115
115
  package_manager.remove(packages, :assumeyes => options[:assumeyes])
@@ -20,7 +20,7 @@ module ForemanMaintain::PackageManager
20
20
  end
21
21
 
22
22
  # rubocop:disable Lint/UnusedMethodArgument
23
- def update(packages = [], assumeyes: false, options: [], download_only: false)
23
+ def update(packages = [], assumeyes: false, download_only: false, enabled_repos: [])
24
24
  action = packages.any? ? '--only-upgrade install' : 'upgrade'
25
25
  apt_action(action, packages, :assumeyes => assumeyes, :download_only => download_only)
26
26
  end
@@ -59,13 +59,13 @@ module ForemanMaintain::PackageManager
59
59
  dnf_action('remove', packages, assumeyes: assumeyes)
60
60
  end
61
61
 
62
- def update(packages = [], assumeyes: false, options: [], download_only: false)
62
+ def update(packages = [], assumeyes: false, download_only: false, enabled_repos: [])
63
63
  dnf_action(
64
64
  'update',
65
65
  packages,
66
66
  assumeyes: assumeyes,
67
- dnf_options: options,
68
- download_only: download_only
67
+ download_only: download_only,
68
+ enabled_repos: enabled_repos
69
69
  )
70
70
  end
71
71
 
@@ -133,14 +133,18 @@ module ForemanMaintain::PackageManager
133
133
 
134
134
  private
135
135
 
136
- # rubocop:disable Layout/LineLength, Metrics/ParameterLists
137
- def dnf_action(action, packages, with_status: false, assumeyes: false, dnf_options: [], valid_exit_statuses: [0], download_only: false)
136
+ # rubocop:disable Layout/LineLength, Metrics/ParameterLists, Metrics/MethodLength
137
+ def dnf_action(action, packages, with_status: false, assumeyes: false, dnf_options: [], valid_exit_statuses: [0], download_only: false, enabled_repos: [])
138
138
  packages = [packages].flatten(1)
139
139
 
140
140
  dnf_options << '-y' if assumeyes
141
141
  dnf_options << '--downloadonly' if download_only
142
142
  dnf_options << '--disableplugin=foreman-protector'
143
143
 
144
+ enabled_repos.map do |id|
145
+ dnf_options << "--enablerepo=#{id}"
146
+ end
147
+
144
148
  command = ['dnf', dnf_options.join(' '), action]
145
149
 
146
150
  command.push(packages.join(' ')) unless packages.empty?
@@ -159,7 +163,7 @@ module ForemanMaintain::PackageManager
159
163
  )
160
164
  end
161
165
  end
162
- # rubocop:enable Layout/LineLength, Metrics/ParameterLists
166
+ # rubocop:enable Layout/LineLength, Metrics/ParameterLists, Metrics/MethodLength
163
167
 
164
168
  def protector_config
165
169
  File.exist?(protector_config_file) ? File.read(protector_config_file) : ''
@@ -183,24 +183,7 @@ module ForemanMaintain
183
183
 
184
184
  def validate_hostname?
185
185
  # make sure that the system hostname is the same as the backup
186
- hostname_from_metadata = metadata.fetch('hostname', nil)
187
- if hostname_from_metadata
188
- hostname_from_metadata == hostname
189
- else
190
- config_tarball = file_map[:config_files][:path]
191
- tar_cmd = "tar zxf #{config_tarball} etc/httpd/conf/httpd.conf --to-stdout --occurrence=1"
192
- status, httpd_config = execute_with_status(tar_cmd)
193
-
194
- # Incremental backups sometimes don't include httpd.conf. Since a "base" backup
195
- # is restored before an incremental, we can assume that the hostname is checked
196
- # during the base backup restore
197
- if status == 0
198
- match = httpd_config.match(/\s*ServerName\s+"*([^ "]+)"*\s*$/)
199
- match ? match[1] == hostname : false
200
- else
201
- true
202
- end
203
- end
186
+ metadata.fetch('hostname', nil) == hostname
204
187
  end
205
188
 
206
189
  def validate_interfaces
@@ -243,7 +226,7 @@ module ForemanMaintain
243
226
  def sql_dump_files_exist?
244
227
  file_map[:foreman_dump][:present] ||
245
228
  file_map[:candlepin_dump][:present] ||
246
- (feature(:pulpcore_database) && file_map[:pulpcore_dump][:present])
229
+ file_map[:pulpcore_dump][:present]
247
230
  end
248
231
 
249
232
  def incremental?
@@ -262,10 +245,6 @@ module ForemanMaintain
262
245
  installed_rpms.any? { |rpm| rpm.start_with?('puppetserver-') }
263
246
  end
264
247
 
265
- def with_qpidd?
266
- installed_rpms.any? { |rpm| rpm.start_with?('qpid-cpp-server-') }
267
- end
268
-
269
248
  def source_os_version
270
249
  metadata.fetch('os_version', 'unknown')
271
250
  end
@@ -1,3 +1,3 @@
1
1
  module ForemanMaintain
2
- VERSION = '1.6.6'.freeze
2
+ VERSION = '1.6.8'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_maintain
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.6
4
+ version: 1.6.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Nečas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-01 00:00:00.000000000 Z
11
+ date: 2024-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: clamp
@@ -160,6 +160,7 @@ files:
160
160
  - definitions/checks/backup/certs_tar_exist.rb
161
161
  - definitions/checks/candlepin/db_up.rb
162
162
  - definitions/checks/check_hotfix_installed.rb
163
+ - definitions/checks/check_ipv6_disable.rb
163
164
  - definitions/checks/check_tmout.rb
164
165
  - definitions/checks/disk/available_space.rb
165
166
  - definitions/checks/disk/available_space_candlepin.rb
@@ -211,7 +212,6 @@ files:
211
212
  - definitions/features/foreman_proxy.rb
212
213
  - definitions/features/foreman_server.rb
213
214
  - definitions/features/foreman_tasks.rb
214
- - definitions/features/gofer.rb
215
215
  - definitions/features/hammer.rb
216
216
  - definitions/features/installer.rb
217
217
  - definitions/features/instance.rb
@@ -274,7 +274,7 @@ files:
274
274
  - definitions/procedures/packages/unlock_versions.rb
275
275
  - definitions/procedures/packages/update.rb
276
276
  - definitions/procedures/packages/update_all_confirmation.rb
277
- - definitions/procedures/pulpcore/migrate.rb
277
+ - definitions/procedures/pulpcore/container_handle_image_metadata.rb
278
278
  - definitions/procedures/pulpcore/trim_rpm_changelogs.rb
279
279
  - definitions/procedures/puppet/delete_empty_ca_cert_request_files.rb
280
280
  - definitions/procedures/puppet/remove_puppet.rb
@@ -286,7 +286,6 @@ files:
286
286
  - definitions/procedures/repositories/enable.rb
287
287
  - definitions/procedures/repositories/setup.rb
288
288
  - definitions/procedures/restore/candlepin_dump.rb
289
- - definitions/procedures/restore/candlepin_reset_migrations.rb
290
289
  - definitions/procedures/restore/configs.rb
291
290
  - definitions/procedures/restore/confirmation.rb
292
291
  - definitions/procedures/restore/drop_databases.rb
@@ -297,7 +296,6 @@ files:
297
296
  - definitions/procedures/restore/pulpcore_dump.rb
298
297
  - definitions/procedures/restore/reindex_databases.rb
299
298
  - definitions/procedures/restore/required_packages.rb
300
- - definitions/procedures/selinux/set_file_security.rb
301
299
  - definitions/procedures/service/base.rb
302
300
  - definitions/procedures/service/daemon_reload.rb
303
301
  - definitions/procedures/service/disable.rb
@@ -310,6 +308,7 @@ files:
310
308
  - definitions/procedures/sync_plans/disable.rb
311
309
  - definitions/procedures/sync_plans/enable.rb
312
310
  - definitions/scenarios/backup.rb
311
+ - definitions/scenarios/foreman_upgrade.rb
313
312
  - definitions/scenarios/maintenance_mode.rb
314
313
  - definitions/scenarios/packages.rb
315
314
  - definitions/scenarios/puppet.rb
@@ -318,11 +317,7 @@ files:
318
317
  - definitions/scenarios/services.rb
319
318
  - definitions/scenarios/update.rb
320
319
  - definitions/scenarios/upgrade_to_capsule_6_16.rb
321
- - definitions/scenarios/upgrade_to_capsule_6_16_z.rb
322
- - definitions/scenarios/upgrade_to_foreman_nightly.rb
323
- - definitions/scenarios/upgrade_to_katello_nightly.rb
324
320
  - definitions/scenarios/upgrade_to_satellite_6_16.rb
325
- - definitions/scenarios/upgrade_to_satellite_6_16_z.rb
326
321
  - extras/foreman-maintain.sh
327
322
  - extras/foreman_protector/dnf/foreman-protector.py
328
323
  - extras/foreman_protector/foreman-protector.conf
@@ -1,16 +0,0 @@
1
- class Features::Gofer < ForemanMaintain::Feature
2
- metadata do
3
- label :gofer
4
-
5
- confine do
6
- find_package('gofer') &&
7
- ForemanMaintain::Utils::Service::Systemd.new('goferd', 0).enabled?
8
- end
9
- end
10
-
11
- def services
12
- [
13
- system_service('goferd', 30),
14
- ]
15
- end
16
- end
@@ -1,24 +0,0 @@
1
- module Procedures::Pulpcore
2
- class Migrate < ForemanMaintain::Procedure
3
- include ForemanMaintain::Concerns::SystemService
4
- include ForemanMaintain::Concerns::PulpCommon
5
-
6
- metadata do
7
- description 'Migrate pulpcore db'
8
- for_feature :pulpcore
9
- end
10
-
11
- def run
12
- with_spinner('Migrating pulpcore') do |spinner|
13
- necessary_services = feature(:pulpcore_database).services
14
- pulp_services = feature(:pulpcore).services
15
-
16
- feature(:service).handle_services(spinner, 'start', :only => necessary_services)
17
- feature(:service).handle_services(spinner, 'stop', :only => pulp_services)
18
-
19
- spinner.update('Migrating pulpcore database')
20
- execute!(pulpcore_manager('migrate --noinput'))
21
- end
22
- end
23
- end
24
- end
@@ -1,14 +0,0 @@
1
- module Procedures::Restore
2
- class CandlepinResetMigrations < ForemanMaintain::Procedure
3
- metadata do
4
- description 'Ensure Candlepin runs all migrations after restoring the database'
5
- confine do
6
- feature(:candlepin_database)
7
- end
8
- end
9
-
10
- def run
11
- FileUtils.rm_f('/var/lib/candlepin/.puppet-candlepin-rpm-version')
12
- end
13
- end
14
- end
@@ -1,25 +0,0 @@
1
- module Procedures::Selinux
2
- class SetFileSecurity < ForemanMaintain::Procedure
3
- metadata do
4
- description 'Setting file security'
5
-
6
- param :incremental_backup,
7
- 'Is the backup incremental?',
8
- :required => true
9
- manual_detection
10
- confine do
11
- File.directory?('/sys/fs/selinux')
12
- end
13
- end
14
-
15
- def run
16
- with_spinner('Restoring SELinux context') do |spinner|
17
- if @incremental_backup
18
- spinner.update('Skipping for incremental update')
19
- else
20
- execute!('restorecon -Rn /')
21
- end
22
- end
23
- end
24
- end
25
- end
@@ -1,97 +0,0 @@
1
- module Scenarios::Capsule_6_16_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.16' || \
9
- ForemanMaintain.upgrade_in_progress == '6.16.z')
10
- end
11
- instance_eval(&block)
12
- end
13
- end
14
-
15
- def target_version
16
- '6.16.z'
17
- end
18
- end
19
-
20
- class PreUpgradeCheck < Abstract
21
- upgrade_metadata do
22
- description 'Checks before upgrading to Capsule 6.16.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.16'))
31
- end
32
- end
33
-
34
- class PreMigrations < Abstract
35
- upgrade_metadata do
36
- description 'Procedures before migrating to Capsule 6.16.z'
37
- tags :pre_migrations
38
- end
39
-
40
- def compose
41
- add_step(Procedures::Repositories::Setup.new(:version => '6.16'))
42
- if el8?
43
- modules_to_enable = ["satellite-capsule:#{el_short_name}"]
44
- add_step(Procedures::Packages::EnableModules.new(:module_names => modules_to_enable))
45
- end
46
- add_step(Procedures::Packages::Update.new(
47
- :assumeyes => true,
48
- :download_only => true
49
- ))
50
- add_steps(find_procedures(:pre_migrations))
51
- end
52
- end
53
-
54
- class Migrations < Abstract
55
- upgrade_metadata do
56
- description 'Migration scripts to Capsule 6.16.z'
57
- tags :migrations
58
- end
59
-
60
- def set_context_mapping
61
- context.map(:assumeyes, Procedures::Installer::Run => :assumeyes)
62
- end
63
-
64
- def compose
65
- add_step(Procedures::Service::Stop.new)
66
- add_step(Procedures::Packages::Update.new(:assumeyes => true, :clean_cache => false))
67
- add_step_with_context(Procedures::Installer::Run)
68
- end
69
- end
70
-
71
- class PostMigrations < Abstract
72
- upgrade_metadata do
73
- description 'Procedures after migrating to Capsule 6.16.z'
74
- tags :post_migrations
75
- end
76
-
77
- def compose
78
- add_step(Procedures::RefreshFeatures)
79
- add_step(Procedures::Service::Start.new)
80
- add_steps(find_procedures(:post_migrations))
81
- end
82
- end
83
-
84
- class PostUpgradeChecks < Abstract
85
- upgrade_metadata do
86
- description 'Checks after upgrading to Capsule 6.16.z'
87
- tags :post_upgrade_checks
88
- run_strategy :fail_slow
89
- end
90
-
91
- def compose
92
- add_steps(find_checks(:default))
93
- add_steps(find_checks(:post_upgrade))
94
- add_step(Procedures::Packages::CheckForReboot)
95
- end
96
- end
97
- end
@@ -1,91 +0,0 @@
1
- module Scenarios::Foreman_Nightly
2
- class Abstract < ForemanMaintain::Scenario
3
- def self.upgrade_metadata(&block)
4
- metadata do
5
- tags :upgrade_scenario
6
- confine do
7
- feature(:foreman_install) || ForemanMaintain.upgrade_in_progress == 'nightly'
8
- end
9
- instance_eval(&block)
10
- end
11
- end
12
-
13
- def target_version
14
- 'nightly'
15
- end
16
- end
17
-
18
- class PreUpgradeCheck < Abstract
19
- upgrade_metadata do
20
- description 'Checks before upgrading to Foreman nightly'
21
- tags :pre_upgrade_checks
22
- run_strategy :fail_slow
23
- end
24
-
25
- def compose
26
- add_steps(find_checks(:default))
27
- add_steps(find_checks(:pre_upgrade))
28
- end
29
- end
30
-
31
- class PreMigrations < Abstract
32
- upgrade_metadata do
33
- description 'Procedures before upgrading to Foreman nightly'
34
- tags :pre_migrations
35
- end
36
-
37
- def compose
38
- add_steps(find_procedures(:pre_migrations))
39
- end
40
- end
41
-
42
- class Migrations < Abstract
43
- upgrade_metadata do
44
- description 'Upgrade steps for Foreman nightly'
45
- tags :migrations
46
- run_strategy :fail_fast
47
- end
48
-
49
- def set_context_mapping
50
- context.map(:assumeyes, Procedures::Installer::Run => :assumeyes)
51
- end
52
-
53
- def compose
54
- add_step(Procedures::Repositories::Setup.new(:version => 'nightly'))
55
- if el8?
56
- modules_to_switch = ['postgresql:13']
57
- add_step(Procedures::Packages::SwitchModules.new(:module_names => modules_to_switch))
58
- modules_to_enable = ["foreman:#{el_short_name}"]
59
- add_step(Procedures::Packages::EnableModules.new(:module_names => modules_to_enable))
60
- end
61
- add_step(Procedures::Packages::Update.new(:assumeyes => true))
62
- add_step_with_context(Procedures::Installer::Run)
63
- end
64
- end
65
-
66
- class PostMigrations < Abstract
67
- upgrade_metadata do
68
- description 'Post upgrade procedures for Foreman nightly'
69
- tags :post_migrations
70
- end
71
-
72
- def compose
73
- add_step(Procedures::RefreshFeatures)
74
- add_step(Procedures::Service::Start.new)
75
- add_steps(find_procedures(:post_migrations))
76
- end
77
- end
78
-
79
- class PostUpgradeChecks < Abstract
80
- upgrade_metadata do
81
- description 'Checks after upgrading to Foreman nightly'
82
- tags :post_upgrade_checks
83
- run_strategy :fail_slow
84
- end
85
-
86
- def compose
87
- add_steps(find_checks(:default))
88
- add_steps(find_checks(:post_upgrade))
89
- end
90
- end
91
- end
@@ -1,96 +0,0 @@
1
- module Scenarios::Katello_Nightly
2
- class Abstract < ForemanMaintain::Scenario
3
- def self.upgrade_metadata(&block)
4
- metadata do
5
- tags :upgrade_scenario
6
- confine do
7
- feature(:katello_install) || ForemanMaintain.upgrade_in_progress == 'nightly'
8
- end
9
- instance_eval(&block)
10
- end
11
- end
12
-
13
- def target_version
14
- 'nightly'
15
- end
16
- end
17
-
18
- class PreUpgradeCheck < Abstract
19
- upgrade_metadata do
20
- description 'Checks before upgrading to Katello nightly'
21
- tags :pre_upgrade_checks
22
- run_strategy :fail_slow
23
- end
24
-
25
- def compose
26
- add_steps(find_checks(:default))
27
- add_steps(find_checks(:pre_upgrade))
28
- end
29
- end
30
-
31
- class PreMigrations < Abstract
32
- upgrade_metadata do
33
- description 'Procedures before upgrading to Katello nightly'
34
- tags :pre_migrations
35
- end
36
-
37
- def compose
38
- add_steps(find_procedures(:pre_migrations))
39
- end
40
- end
41
-
42
- class Migrations < Abstract
43
- upgrade_metadata do
44
- description 'Upgrade steps for Katello nightly'
45
- tags :migrations
46
- run_strategy :fail_fast
47
- end
48
-
49
- def set_context_mapping
50
- context.map(:assumeyes, Procedures::Installer::Run => :assumeyes)
51
- end
52
-
53
- def compose
54
- add_step(Procedures::Repositories::Setup.new(:version => 'nightly'))
55
- if el8?
56
- modules_to_switch = ['postgresql:13']
57
- add_step(Procedures::Packages::SwitchModules.new(:module_names => modules_to_switch))
58
- modules_to_enable = ["katello:#{el_short_name}", "pulpcore:#{el_short_name}"]
59
- add_step(Procedures::Packages::EnableModules.new(:module_names => modules_to_enable))
60
- end
61
- add_step(Procedures::Packages::Update.new(
62
- :assumeyes => true,
63
- :download_only => true
64
- ))
65
- add_step(Procedures::Service::Stop.new)
66
- add_step(Procedures::Packages::Update.new(:assumeyes => true, :clean_cache => false))
67
- add_step_with_context(Procedures::Installer::Run)
68
- end
69
- end
70
-
71
- class PostMigrations < Abstract
72
- upgrade_metadata do
73
- description 'Post upgrade procedures for Katello nightly'
74
- tags :post_migrations
75
- end
76
-
77
- def compose
78
- add_step(Procedures::RefreshFeatures)
79
- add_step(Procedures::Service::Start.new)
80
- add_steps(find_procedures(:post_migrations))
81
- end
82
- end
83
-
84
- class PostUpgradeChecks < Abstract
85
- upgrade_metadata do
86
- description 'Checks after upgrading to Katello nightly'
87
- tags :post_upgrade_checks
88
- run_strategy :fail_slow
89
- end
90
-
91
- def compose
92
- add_steps(find_checks(:default))
93
- add_steps(find_checks(:post_upgrade))
94
- end
95
- end
96
- end