foreman_maintain 1.4.3 → 1.5.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.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/definitions/checks/foreman_tasks/not_paused.rb +1 -1
  3. data/definitions/checks/package_manager/dnf/validate_dnf_config.rb +1 -1
  4. data/definitions/features/candlepin_database.rb +1 -1
  5. data/definitions/features/foreman_database.rb +1 -1
  6. data/definitions/features/installer.rb +0 -1
  7. data/definitions/features/pulpcore.rb +1 -1
  8. data/definitions/features/pulpcore_database.rb +1 -1
  9. data/definitions/features/service.rb +2 -2
  10. data/definitions/procedures/backup/offline/foreman_db.rb +1 -1
  11. data/definitions/procedures/backup/online/safety_confirmation.rb +1 -1
  12. data/definitions/procedures/backup/snapshot/mount_base.rb +1 -1
  13. data/definitions/procedures/foreman/fix_corrupted_roles.rb +1 -1
  14. data/definitions/procedures/maintenance_mode/is_enabled.rb +1 -1
  15. data/definitions/procedures/packages/check_for_reboot.rb +1 -1
  16. data/definitions/scenarios/backup.rb +1 -1
  17. data/definitions/scenarios/{upgrade_to_capsule_6_15_z.rb → upgrade_to_capsule_6_16.rb} +10 -10
  18. data/definitions/scenarios/{upgrade_to_capsule_6_15.rb → upgrade_to_capsule_6_16_z.rb} +11 -11
  19. data/definitions/scenarios/{upgrade_to_satellite_6_15_z.rb → upgrade_to_satellite_6_16.rb} +11 -10
  20. data/definitions/scenarios/{upgrade_to_satellite_6_15.rb → upgrade_to_satellite_6_16_z.rb} +11 -12
  21. data/lib/foreman_maintain/concerns/base_database.rb +1 -1
  22. data/lib/foreman_maintain/concerns/system_helpers.rb +1 -1
  23. data/lib/foreman_maintain/executable.rb +6 -2
  24. data/lib/foreman_maintain/reporter/cli_reporter.rb +3 -2
  25. data/lib/foreman_maintain/reporter.rb +1 -1
  26. data/lib/foreman_maintain/runner/execution.rb +4 -0
  27. data/lib/foreman_maintain/scenario.rb +8 -0
  28. data/lib/foreman_maintain/utils/service/abstract.rb +1 -1
  29. data/lib/foreman_maintain/version.rb +1 -1
  30. data/lib/foreman_maintain/yaml_storage.rb +1 -1
  31. metadata +6 -7
  32. data/definitions/checks/katello_agent.rb +0 -41
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2d9b46e0f2566916075ef7ec1972734f31919fafaa10ce814a2e5006ece9ab62
4
- data.tar.gz: 989952ede4062aaba32b380a5226b63e9aaa0c22ffbf34b79bc80a153a0b0920
3
+ metadata.gz: 100d751c774b8d059da095d52e16b0f550d07cfc452dde7416c02268dceceea0
4
+ data.tar.gz: 4d321b112aed2dd01a6f4175a66ce0f70a58b40a66da9b476bda3eb12a4697ca
5
5
  SHA512:
6
- metadata.gz: a9a380eb151bfadbbba33824d438dc69fe47732cf3219af14b8e78ebcb2bb8dd5ba590fc9887d936aa1eb662e644f8e085a39c2023a71e5d3d975075d37a57bb
7
- data.tar.gz: 7725d0d13f08191822fbda79b828498d8b064a984ca8d38a841d1e400768ec6c530ea8d99c94ea35f6a62ac547455de32a9d4048d06a3d4a953fd065908385d1
6
+ metadata.gz: 3b1760b02ab02ad1918de24f7aef1f761cf24aefb76ab0191d360cd14b430255926fff5971b349f7f18cd0736664add545af2a3a0a04b73e3e6e71a7b75952ae
7
+ data.tar.gz: 806f8f9c132c662b9e5a812520589a59c4986783b1962389705d5743f901bfd157c5fb9bf4c16455c80678d3033648d6f0ee36f41045bbbae59e097d62381624
@@ -9,7 +9,7 @@ module Checks::ForemanTasks
9
9
  end
10
10
 
11
11
  def run
12
- paused_tasks_count = feature(:foreman_tasks).paused_tasks_count()
12
+ paused_tasks_count = feature(:foreman_tasks).paused_tasks_count
13
13
  assert(paused_tasks_count == 0,
14
14
  "There are currently #{paused_tasks_count} paused tasks in the system",
15
15
  :next_steps => next_procedures)
@@ -19,7 +19,7 @@ module Checks::PackageManager
19
19
 
20
20
  # rubocop:disable Metrics/LineLength
21
21
  def failure_message(final_result)
22
- verb_string = final_result[:matched_keys].length > 1 ? 'are' : 'is'
22
+ verb_string = (final_result[:matched_keys].length > 1) ? 'are' : 'is'
23
23
 
24
24
  "#{final_result[:matched_keys].join(',')} #{verb_string} set in /etc/dnf/dnf.conf as below:"\
25
25
  "\n#{final_result[:grep_output]}"\
@@ -14,7 +14,7 @@ class Features::CandlepinDatabase < ForemanMaintain::Feature
14
14
  def services
15
15
  [
16
16
  system_service('postgresql', 10, :component => 'candlepin',
17
- :db_feature => feature(:candlepin_database)),
17
+ :db_feature => feature(:candlepin_database)),
18
18
  ]
19
19
  end
20
20
 
@@ -28,7 +28,7 @@ class Features::ForemanDatabase < ForemanMaintain::Feature
28
28
  def services
29
29
  [
30
30
  system_service('postgresql', 10, :component => 'foreman',
31
- :db_feature => feature(:foreman_database)),
31
+ :db_feature => feature(:foreman_database)),
32
32
  ]
33
33
  end
34
34
 
@@ -30,7 +30,6 @@ class Features::Installer < ForemanMaintain::Feature
30
30
  def config_files
31
31
  Dir.glob(File.join(config_directory, '**/*')) +
32
32
  [
33
- '/usr/local/bin/validate_postgresql_connection.sh',
34
33
  '/opt/puppetlabs/puppet/cache/foreman_cache_data',
35
34
  '/opt/puppetlabs/puppet/cache/pulpcore_cache_data',
36
35
  ]
@@ -19,7 +19,7 @@ class Features::Pulpcore < ForemanMaintain::Feature
19
19
  names = names.map { |f| File.basename(f) }
20
20
  names.map do |name|
21
21
  system_service(name, 20, :skip_enablement => true,
22
- :instance_parent_unit => 'pulpcore-worker@')
22
+ :instance_parent_unit => 'pulpcore-worker@')
23
23
  end
24
24
  end
25
25
 
@@ -20,7 +20,7 @@ class Features::PulpcoreDatabase < ForemanMaintain::Feature
20
20
  def services
21
21
  [
22
22
  system_service('postgresql', 10, :component => 'pulpcore',
23
- :db_feature => feature(:pulpcore_database)),
23
+ :db_feature => feature(:pulpcore_database)),
24
24
  ]
25
25
  end
26
26
 
@@ -15,7 +15,7 @@ class Features::Service < ForemanMaintain::Feature
15
15
  ForemanMaintain.available_features.flat_map(&:services).
16
16
  sort.
17
17
  inject([]) do |pool, service| # uniq(&:to_s) for ruby 1.8.7
18
- pool.last.nil? || !pool.last.matches?(service) ? pool << service : pool
18
+ (pool.last.nil? || !pool.last.matches?(service)) ? pool << service : pool
19
19
  end.
20
20
  select(&:exist?)
21
21
  end
@@ -109,7 +109,7 @@ class Features::Service < ForemanMaintain::Feature
109
109
  end
110
110
 
111
111
  def format_brief_status(exit_code)
112
- result = exit_code == 0 ? reporter.status_label(:success) : reporter.status_label(:fail)
112
+ result = (exit_code == 0) ? reporter.status_label(:success) : reporter.status_label(:fail)
113
113
  padding = reporter.max_length - reporter.last_line.to_s.length - 30
114
114
  "#{' ' * padding} #{result}"
115
115
  end
@@ -33,7 +33,7 @@ module Procedures::Backup
33
33
  def local_backup
34
34
  with_spinner("Collecting data from #{pg_data_dirs.join(',')}") do
35
35
  pg_data_dirs.each_with_index do |pg_dir, index|
36
- do_backup(pg_dir, index == 0 ? 'create' : 'append')
36
+ do_backup(pg_dir, (index == 0) ? 'create' : 'append')
37
37
  end
38
38
  end
39
39
  end
@@ -5,7 +5,7 @@ module Procedures::Backup
5
5
  description 'Data consistency warning'
6
6
  tags :backup
7
7
  param :include_db_dumps, 'Are database dumps included in backup', :flag => true,
8
- :default => false
8
+ :default => false
9
9
  end
10
10
 
11
11
  def run
@@ -14,7 +14,7 @@ module Procedures::Backup
14
14
 
15
15
  def mount_snapshot(database, lv_type)
16
16
  FileUtils.mkdir_p(mount_location(database))
17
- options = lv_type == 'xfs' ? '-onouuid,ro' : '-oro'
17
+ options = (lv_type == 'xfs') ? '-onouuid,ro' : '-oro'
18
18
  lv_name = "#{database}-snap"
19
19
  execute!("mount #{get_lv_path(lv_name)} #{mount_location(database)} #{options}")
20
20
  end
@@ -26,7 +26,7 @@ module Procedures::Foreman
26
26
 
27
27
  def find_records_to_update(inconsistent_sets)
28
28
  largest_set = inconsistent_sets.reduce([]) do |memo, set|
29
- set.count > memo.count ? set : memo
29
+ (set.count > memo.count) ? set : memo
30
30
  end
31
31
 
32
32
  inconsistent_sets.reject do |set|
@@ -12,7 +12,7 @@ module Procedures::MaintenanceMode
12
12
 
13
13
  def run
14
14
  @status_code = feature(:instance).firewall.maintenance_mode_status? ? 0 : 1
15
- puts "Maintenance mode is #{@status_code == 1 ? 'Off' : 'On'}"
15
+ puts "Maintenance mode is #{(@status_code == 1) ? 'Off' : 'On'}"
16
16
  end
17
17
  end
18
18
  end
@@ -7,7 +7,7 @@ module Procedures::Packages
7
7
  def run
8
8
  status, output = execute_with_status('dnf needs-restarting --reboothint')
9
9
  if status == 1
10
- set_status(:warning, output)
10
+ set_info_warn(output)
11
11
  else
12
12
  set_status(:success, output)
13
13
  end
@@ -195,7 +195,7 @@ module ForemanMaintain::Scenarios
195
195
 
196
196
  def add_online_backup_steps
197
197
  add_step_with_context(Procedures::Backup::ConfigFiles, :ignore_changed_files => true,
198
- :online_backup => true)
198
+ :online_backup => true)
199
199
  add_step_with_context(Procedures::Backup::Pulp, :ensure_unchanged => true)
200
200
  add_steps_with_context(
201
201
  Procedures::Backup::Online::CandlepinDB,
@@ -1,4 +1,4 @@
1
- module Scenarios::Capsule_6_15_z
1
+ module Scenarios::Capsule_6_16
2
2
  class Abstract < ForemanMaintain::Scenario
3
3
  def self.upgrade_metadata(&block)
4
4
  metadata do
@@ -6,20 +6,20 @@ module Scenarios::Capsule_6_15_z
6
6
  confine do
7
7
  feature(:capsule) &&
8
8
  (feature(:capsule).current_minor_version == '6.15' || \
9
- ForemanMaintain.upgrade_in_progress == '6.15.z')
9
+ ForemanMaintain.upgrade_in_progress == '6.16')
10
10
  end
11
11
  instance_eval(&block)
12
12
  end
13
13
  end
14
14
 
15
15
  def target_version
16
- '6.15.z'
16
+ '6.16'
17
17
  end
18
18
  end
19
19
 
20
20
  class PreUpgradeCheck < Abstract
21
21
  upgrade_metadata do
22
- description 'Checks before upgrading to Capsule 6.15.z'
22
+ description 'Checks before upgrading to Capsule 6.16'
23
23
  tags :pre_upgrade_checks
24
24
  run_strategy :fail_slow
25
25
  end
@@ -27,13 +27,13 @@ module Scenarios::Capsule_6_15_z
27
27
  def compose
28
28
  add_steps(find_checks(:default))
29
29
  add_steps(find_checks(:pre_upgrade))
30
- add_step(Checks::Repositories::Validate.new(:version => '6.15'))
30
+ add_step(Checks::Repositories::Validate.new(:version => '6.16'))
31
31
  end
32
32
  end
33
33
 
34
34
  class PreMigrations < Abstract
35
35
  upgrade_metadata do
36
- description 'Procedures before migrating to Capsule 6.15.z'
36
+ description 'Procedures before migrating to Capsule 6.16'
37
37
  tags :pre_migrations
38
38
  end
39
39
 
@@ -44,7 +44,7 @@ module Scenarios::Capsule_6_15_z
44
44
 
45
45
  class Migrations < Abstract
46
46
  upgrade_metadata do
47
- description 'Migration scripts to Capsule 6.15.z'
47
+ description 'Migration scripts to Capsule 6.16'
48
48
  tags :migrations
49
49
  end
50
50
 
@@ -53,7 +53,7 @@ module Scenarios::Capsule_6_15_z
53
53
  end
54
54
 
55
55
  def compose
56
- add_step(Procedures::Repositories::Setup.new(:version => '6.15'))
56
+ add_step(Procedures::Repositories::Setup.new(:version => '6.16'))
57
57
  modules_to_enable = ["satellite-capsule:#{el_short_name}"]
58
58
  add_step(Procedures::Packages::EnableModules.new(:module_names => modules_to_enable))
59
59
  add_step(Procedures::Packages::Update.new(:assumeyes => true,
@@ -66,7 +66,7 @@ module Scenarios::Capsule_6_15_z
66
66
 
67
67
  class PostMigrations < Abstract
68
68
  upgrade_metadata do
69
- description 'Procedures after migrating to Capsule 6.15.z'
69
+ description 'Procedures after migrating to Capsule 6.16'
70
70
  tags :post_migrations
71
71
  end
72
72
 
@@ -79,7 +79,7 @@ module Scenarios::Capsule_6_15_z
79
79
 
80
80
  class PostUpgradeChecks < Abstract
81
81
  upgrade_metadata do
82
- description 'Checks after upgrading to Capsule 6.15.z'
82
+ description 'Checks after upgrading to Capsule 6.16'
83
83
  tags :post_upgrade_checks
84
84
  run_strategy :fail_slow
85
85
  end
@@ -1,25 +1,25 @@
1
- module Scenarios::Capsule_6_15
1
+ module Scenarios::Capsule_6_16_z
2
2
  class Abstract < ForemanMaintain::Scenario
3
3
  def self.upgrade_metadata(&block)
4
4
  metadata do
5
5
  tags :upgrade_scenario
6
6
  confine do
7
7
  feature(:capsule) &&
8
- (feature(:capsule).current_minor_version == '6.14' || \
9
- ForemanMaintain.upgrade_in_progress == '6.15')
8
+ (feature(:capsule).current_minor_version == '6.16' || \
9
+ ForemanMaintain.upgrade_in_progress == '6.16.z')
10
10
  end
11
11
  instance_eval(&block)
12
12
  end
13
13
  end
14
14
 
15
15
  def target_version
16
- '6.15'
16
+ '6.16.z'
17
17
  end
18
18
  end
19
19
 
20
20
  class PreUpgradeCheck < Abstract
21
21
  upgrade_metadata do
22
- description 'Checks before upgrading to Capsule 6.15'
22
+ description 'Checks before upgrading to Capsule 6.16.z'
23
23
  tags :pre_upgrade_checks
24
24
  run_strategy :fail_slow
25
25
  end
@@ -27,13 +27,13 @@ module Scenarios::Capsule_6_15
27
27
  def compose
28
28
  add_steps(find_checks(:default))
29
29
  add_steps(find_checks(:pre_upgrade))
30
- add_step(Checks::Repositories::Validate.new(:version => '6.15'))
30
+ add_step(Checks::Repositories::Validate.new(:version => '6.16'))
31
31
  end
32
32
  end
33
33
 
34
34
  class PreMigrations < Abstract
35
35
  upgrade_metadata do
36
- description 'Procedures before migrating to Capsule 6.15'
36
+ description 'Procedures before migrating to Capsule 6.16.z'
37
37
  tags :pre_migrations
38
38
  end
39
39
 
@@ -44,7 +44,7 @@ module Scenarios::Capsule_6_15
44
44
 
45
45
  class Migrations < Abstract
46
46
  upgrade_metadata do
47
- description 'Migration scripts to Capsule 6.15'
47
+ description 'Migration scripts to Capsule 6.16.z'
48
48
  tags :migrations
49
49
  end
50
50
 
@@ -53,7 +53,7 @@ module Scenarios::Capsule_6_15
53
53
  end
54
54
 
55
55
  def compose
56
- add_step(Procedures::Repositories::Setup.new(:version => '6.15'))
56
+ add_step(Procedures::Repositories::Setup.new(:version => '6.16'))
57
57
  modules_to_enable = ["satellite-capsule:#{el_short_name}"]
58
58
  add_step(Procedures::Packages::EnableModules.new(:module_names => modules_to_enable))
59
59
  add_step(Procedures::Packages::Update.new(:assumeyes => true,
@@ -66,7 +66,7 @@ module Scenarios::Capsule_6_15
66
66
 
67
67
  class PostMigrations < Abstract
68
68
  upgrade_metadata do
69
- description 'Procedures after migrating to Capsule 6.15'
69
+ description 'Procedures after migrating to Capsule 6.16.z'
70
70
  tags :post_migrations
71
71
  end
72
72
 
@@ -79,7 +79,7 @@ module Scenarios::Capsule_6_15
79
79
 
80
80
  class PostUpgradeChecks < Abstract
81
81
  upgrade_metadata do
82
- description 'Checks after upgrading to Capsule 6.15'
82
+ description 'Checks after upgrading to Capsule 6.16.z'
83
83
  tags :post_upgrade_checks
84
84
  run_strategy :fail_slow
85
85
  end
@@ -1,4 +1,4 @@
1
- module Scenarios::Satellite_6_15_z
1
+ module Scenarios::Satellite_6_16
2
2
  class Abstract < ForemanMaintain::Scenario
3
3
  def self.upgrade_metadata(&block)
4
4
  metadata do
@@ -6,20 +6,20 @@ module Scenarios::Satellite_6_15_z
6
6
  confine do
7
7
  feature(:satellite) &&
8
8
  (feature(:satellite).current_minor_version == '6.15' || \
9
- ForemanMaintain.upgrade_in_progress == '6.15.z')
9
+ ForemanMaintain.upgrade_in_progress == '6.16')
10
10
  end
11
11
  instance_eval(&block)
12
12
  end
13
13
  end
14
14
 
15
15
  def target_version
16
- '6.15.z'
16
+ '6.16'
17
17
  end
18
18
  end
19
19
 
20
20
  class PreUpgradeCheck < Abstract
21
21
  upgrade_metadata do
22
- description 'Checks before upgrading to Satellite 6.15.z'
22
+ description 'Checks before upgrading to Satellite 6.16'
23
23
  tags :pre_upgrade_checks
24
24
  run_strategy :fail_slow
25
25
  end
@@ -27,13 +27,13 @@ module Scenarios::Satellite_6_15_z
27
27
  def compose
28
28
  add_steps(find_checks(:default))
29
29
  add_steps(find_checks(:pre_upgrade))
30
- add_step(Checks::Repositories::Validate.new(:version => '6.15'))
30
+ add_step(Checks::Repositories::Validate.new(:version => '6.16'))
31
31
  end
32
32
  end
33
33
 
34
34
  class PreMigrations < Abstract
35
35
  upgrade_metadata do
36
- description 'Procedures before migrating to Satellite 6.15.z'
36
+ description 'Procedures before migrating to Satellite 6.16'
37
37
  tags :pre_migrations
38
38
  end
39
39
 
@@ -44,8 +44,9 @@ module Scenarios::Satellite_6_15_z
44
44
 
45
45
  class Migrations < Abstract
46
46
  upgrade_metadata do
47
- description 'Migration scripts to Satellite 6.15.z'
47
+ description 'Migration scripts to Satellite 6.16'
48
48
  tags :migrations
49
+ run_strategy :fail_fast
49
50
  end
50
51
 
51
52
  def set_context_mapping
@@ -53,7 +54,7 @@ module Scenarios::Satellite_6_15_z
53
54
  end
54
55
 
55
56
  def compose
56
- add_step(Procedures::Repositories::Setup.new(:version => '6.15'))
57
+ add_step(Procedures::Repositories::Setup.new(:version => '6.16'))
57
58
  modules_to_enable = ["satellite:#{el_short_name}"]
58
59
  add_step(Procedures::Packages::EnableModules.new(:module_names => modules_to_enable))
59
60
  add_step(Procedures::Packages::Update.new(:assumeyes => true,
@@ -67,7 +68,7 @@ module Scenarios::Satellite_6_15_z
67
68
 
68
69
  class PostMigrations < Abstract
69
70
  upgrade_metadata do
70
- description 'Procedures after migrating to Satellite 6.15.z'
71
+ description 'Procedures after migrating to Satellite 6.16'
71
72
  tags :post_migrations
72
73
  end
73
74
 
@@ -80,7 +81,7 @@ module Scenarios::Satellite_6_15_z
80
81
 
81
82
  class PostUpgradeChecks < Abstract
82
83
  upgrade_metadata do
83
- description 'Checks after upgrading to Satellite 6.15.z'
84
+ description 'Checks after upgrading to Satellite 6.16'
84
85
  tags :post_upgrade_checks
85
86
  run_strategy :fail_slow
86
87
  end
@@ -1,25 +1,25 @@
1
- module Scenarios::Satellite_6_15
1
+ module Scenarios::Satellite_6_16_z
2
2
  class Abstract < ForemanMaintain::Scenario
3
3
  def self.upgrade_metadata(&block)
4
4
  metadata do
5
5
  tags :upgrade_scenario
6
6
  confine do
7
7
  feature(:satellite) &&
8
- (feature(:satellite).current_minor_version == '6.14' || \
9
- ForemanMaintain.upgrade_in_progress == '6.15')
8
+ (feature(:satellite).current_minor_version == '6.16' || \
9
+ ForemanMaintain.upgrade_in_progress == '6.16.z')
10
10
  end
11
11
  instance_eval(&block)
12
12
  end
13
13
  end
14
14
 
15
15
  def target_version
16
- '6.15'
16
+ '6.16.z'
17
17
  end
18
18
  end
19
19
 
20
20
  class PreUpgradeCheck < Abstract
21
21
  upgrade_metadata do
22
- description 'Checks before upgrading to Satellite 6.15'
22
+ description 'Checks before upgrading to Satellite 6.16.z'
23
23
  tags :pre_upgrade_checks
24
24
  run_strategy :fail_slow
25
25
  end
@@ -27,13 +27,13 @@ module Scenarios::Satellite_6_15
27
27
  def compose
28
28
  add_steps(find_checks(:default))
29
29
  add_steps(find_checks(:pre_upgrade))
30
- add_step(Checks::Repositories::Validate.new(:version => '6.15'))
30
+ add_step(Checks::Repositories::Validate.new(:version => '6.16'))
31
31
  end
32
32
  end
33
33
 
34
34
  class PreMigrations < Abstract
35
35
  upgrade_metadata do
36
- description 'Procedures before migrating to Satellite 6.15'
36
+ description 'Procedures before migrating to Satellite 6.16.z'
37
37
  tags :pre_migrations
38
38
  end
39
39
 
@@ -44,9 +44,8 @@ module Scenarios::Satellite_6_15
44
44
 
45
45
  class Migrations < Abstract
46
46
  upgrade_metadata do
47
- description 'Migration scripts to Satellite 6.15'
47
+ description 'Migration scripts to Satellite 6.16.z'
48
48
  tags :migrations
49
- run_strategy :fail_fast
50
49
  end
51
50
 
52
51
  def set_context_mapping
@@ -54,7 +53,7 @@ module Scenarios::Satellite_6_15
54
53
  end
55
54
 
56
55
  def compose
57
- add_step(Procedures::Repositories::Setup.new(:version => '6.15'))
56
+ add_step(Procedures::Repositories::Setup.new(:version => '6.16'))
58
57
  modules_to_enable = ["satellite:#{el_short_name}"]
59
58
  add_step(Procedures::Packages::EnableModules.new(:module_names => modules_to_enable))
60
59
  add_step(Procedures::Packages::Update.new(:assumeyes => true,
@@ -68,7 +67,7 @@ module Scenarios::Satellite_6_15
68
67
 
69
68
  class PostMigrations < Abstract
70
69
  upgrade_metadata do
71
- description 'Procedures after migrating to Satellite 6.15'
70
+ description 'Procedures after migrating to Satellite 6.16.z'
72
71
  tags :post_migrations
73
72
  end
74
73
 
@@ -81,7 +80,7 @@ module Scenarios::Satellite_6_15
81
80
 
82
81
  class PostUpgradeChecks < Abstract
83
82
  upgrade_metadata do
84
- description 'Checks after upgrading to Satellite 6.15'
83
+ description 'Checks after upgrading to Satellite 6.16.z'
85
84
  tags :post_upgrade_checks
86
85
  run_strategy :fail_slow
87
86
  end
@@ -90,7 +90,7 @@ module ForemanMaintain
90
90
  ' --no-privileges --clean --disable-triggers -n public ' \
91
91
  "-d #{config['database']} #{file}"
92
92
  execute!(dump_cmd, :hidden_patterns => [config['password']],
93
- :valid_exit_statuses => [0, 1])
93
+ :valid_exit_statuses => [0, 1])
94
94
  end
95
95
  end
96
96
 
@@ -106,7 +106,7 @@ module ForemanMaintain
106
106
  package_manager.install(packages, :assumeyes => options[:assumeyes])
107
107
  when :update
108
108
  package_manager.update(packages, :assumeyes => options[:assumeyes],
109
- :dnf_options => options[:dnf_options])
109
+ :dnf_options => options[:dnf_options])
110
110
  when :remove
111
111
  package_manager.remove(packages, :assumeyes => options[:assumeyes])
112
112
  else
@@ -5,7 +5,7 @@ module ForemanMaintain
5
5
  attr_reader :options
6
6
 
7
7
  def_delegators :execution,
8
- :success?, :skipped?, :fail?, :aborted?, :warning?, :output,
8
+ :success?, :skipped?, :fail?, :aborted?, :warning?, :info_warning?, :output,
9
9
  :assumeyes?, :whitelisted?, :ask_decision,
10
10
  :execution, :puts, :print, :with_spinner, :ask, :storage
11
11
 
@@ -91,6 +91,10 @@ module ForemanMaintain
91
91
  set_status(:warning, message)
92
92
  end
93
93
 
94
+ def set_info_warn(message)
95
+ set_status(:info_warning, message)
96
+ end
97
+
94
98
  def set_skip(message)
95
99
  set_status(:skipped, message)
96
100
  end
@@ -173,7 +177,7 @@ module ForemanMaintain
173
177
  raise "The step is not matching the hash #{hash.inspect}" unless matches_hash?(hash)
174
178
  raise "Can't update step that was already executed" if @_execution
175
179
  @_execution = Runner::StoredExecution.new(self, :status => hash[:status],
176
- :output => hash[:output])
180
+ :output => hash[:output])
177
181
  end
178
182
 
179
183
  def inspect
@@ -228,7 +228,7 @@ module ForemanMaintain
228
228
  end
229
229
 
230
230
  until_valid_decision do
231
- actions = run_strategy == :fail_slow ? 'n(next)' : 'n(next), q(quit)'
231
+ actions = (run_strategy == :fail_slow) ? 'n(next)' : 'n(next), q(quit)'
232
232
  answer = ask("#{message}, [#{actions}]")
233
233
  if answer =~ /^\d+$/ && (answer.to_i - 1) < steps.size
234
234
  steps[answer.to_i - 1]
@@ -276,7 +276,8 @@ module ForemanMaintain
276
276
  :running => { :label => '[RUNNING]', :color => :blue },
277
277
  :skipped => { :label => '[SKIPPED]', :color => :yellow },
278
278
  :already_run => { :label => '[ALREADY RUN]', :color => :yellow },
279
- :warning => { :label => '[WARNING]', :color => :yellow } }
279
+ :warning => { :label => '[WARNING]', :color => :yellow },
280
+ :info_warning => { :label => '[WARNING]', :color => :yellow } }
280
281
  properties = mapping[status]
281
282
  if @plaintext
282
283
  properties[:label]
@@ -113,7 +113,7 @@ module ForemanMaintain
113
113
  return steps.first
114
114
  end
115
115
  until_valid_decision do
116
- actions = run_strategy == :fail_slow ? 'n(next)' : 'n(next), q(quit)'
116
+ actions = (run_strategy == :fail_slow) ? 'n(next)' : 'n(next), q(quit)'
117
117
 
118
118
  answer = ask("#{message}, [#{actions}]")
119
119
  if answer =~ /^\d+$/ && (answer.to_i - 1) < steps.size
@@ -63,6 +63,10 @@ module ForemanMaintain
63
63
  @status == :warning
64
64
  end
65
65
 
66
+ def info_warning?
67
+ @status == :info_warning
68
+ end
69
+
66
70
  # yaml storage to preserve key/value pairs between runs.
67
71
  def storage
68
72
  @storage || ForemanMaintain.storage(:default)
@@ -119,6 +119,10 @@ module ForemanMaintain
119
119
  filter_whitelisted(executed_steps.find_all(&:warning?), options)
120
120
  end
121
121
 
122
+ def steps_with_info_warning(options = {})
123
+ filter_whitelisted(executed_steps.find_all(&:info_warning?), options)
124
+ end
125
+
122
126
  def steps_with_skipped(options = {})
123
127
  filter_whitelisted(executed_steps.find_all(&:skipped?), options)
124
128
  end
@@ -143,6 +147,10 @@ module ForemanMaintain
143
147
  !steps_with_warning(:whitelisted => false).empty?
144
148
  end
145
149
 
150
+ def info_warning?
151
+ !steps_with_info_warning(:whitelisted => false).empty?
152
+ end
153
+
146
154
  def failed?
147
155
  !passed?
148
156
  end
@@ -18,7 +18,7 @@ module ForemanMaintain::Utils
18
18
 
19
19
  def <=>(other)
20
20
  prio_cmp = @priority <=> other.priority
21
- prio_cmp == 0 ? @name <=> other.name : prio_cmp
21
+ (prio_cmp == 0) ? @name <=> other.name : prio_cmp
22
22
  end
23
23
 
24
24
  def to_s
@@ -1,3 +1,3 @@
1
1
  module ForemanMaintain
2
- VERSION = '1.4.3'.freeze
2
+ VERSION = '1.5.0'.freeze
3
3
  end
@@ -47,7 +47,7 @@ module ForemanMaintain
47
47
  end
48
48
 
49
49
  def save_all
50
- storage_register.values.each(&:save)
50
+ storage_register.each_value(&:save)
51
51
  end
52
52
  end
53
53
  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.4.3
4
+ version: 1.5.0
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: 2023-11-06 00:00:00.000000000 Z
11
+ date: 2024-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: clamp
@@ -181,7 +181,6 @@ files:
181
181
  - definitions/checks/foreman_tasks/invalid/check_planning_state.rb
182
182
  - definitions/checks/foreman_tasks/not_paused.rb
183
183
  - definitions/checks/foreman_tasks/not_running.rb
184
- - definitions/checks/katello_agent.rb
185
184
  - definitions/checks/maintenance_mode/check_consistency.rb
186
185
  - definitions/checks/non_rh_packages.rb
187
186
  - definitions/checks/package_manager/dnf/validate_dnf_config.rb
@@ -327,12 +326,12 @@ files:
327
326
  - definitions/scenarios/restore.rb
328
327
  - definitions/scenarios/self_upgrade.rb
329
328
  - definitions/scenarios/services.rb
330
- - definitions/scenarios/upgrade_to_capsule_6_15.rb
331
- - definitions/scenarios/upgrade_to_capsule_6_15_z.rb
329
+ - definitions/scenarios/upgrade_to_capsule_6_16.rb
330
+ - definitions/scenarios/upgrade_to_capsule_6_16_z.rb
332
331
  - definitions/scenarios/upgrade_to_foreman_nightly.rb
333
332
  - definitions/scenarios/upgrade_to_katello_nightly.rb
334
- - definitions/scenarios/upgrade_to_satellite_6_15.rb
335
- - definitions/scenarios/upgrade_to_satellite_6_15_z.rb
333
+ - definitions/scenarios/upgrade_to_satellite_6_16.rb
334
+ - definitions/scenarios/upgrade_to_satellite_6_16_z.rb
336
335
  - extras/foreman-maintain.sh
337
336
  - extras/foreman_protector/dnf/foreman-protector.py
338
337
  - extras/foreman_protector/foreman-protector.conf
@@ -1,41 +0,0 @@
1
- require 'yaml'
2
-
3
- class Checks::CheckKatelloAgentEnabled < ForemanMaintain::Check
4
- metadata do
5
- label :check_katello_agent_enabled
6
- description 'Check whether the katello-agent feature is enabled before upgrading'
7
- tags :pre_upgrade
8
-
9
- confine do
10
- !feature(:capsule)
11
- end
12
- end
13
-
14
- def run
15
- instance_name = feature(:instance).downstream ? "Satellite" : "Katello"
16
- instance_version = feature(:instance).downstream ? "6.15" : "4.10"
17
- installer_command = feature(:instance).downstream ? "satellite-installer" : "foreman-installer"
18
- maintain_command = feature(:instance).downstream ? "satellite-maintain" : "foreman-maintain"
19
-
20
- assert(
21
- !katello_agent_enabled?,
22
- "The katello-agent feature is enabled on this system. As of #{instance_name}"\
23
- " #{instance_version}, katello-agent is removed and will no longer function."\
24
- " Before proceeding with the upgrade, you should ensure that you have deployed"\
25
- " and configured an alternative tool for remote package management and patching"\
26
- " for content hosts, such as Remote Execution (REX) with pull-based transport."\
27
- " See the Managing Hosts guide in the #{instance_name} documentation for more info."\
28
- " Disable katello-agent with the command"\
29
- " `#{installer_command} --foreman-proxy-content-enable-katello-agent false`"\
30
- " before proceeding with the upgrade. Alternatively, you may skip this check and proceed by"\
31
- " running #{maintain_command} again with the `--whitelist` option, which will automatically"\
32
- " uninstall katello-agent."
33
- )
34
- end
35
-
36
- private
37
-
38
- def katello_agent_enabled?
39
- feature(:installer).answers['foreman_proxy_content']['enable_katello_agent']
40
- end
41
- end