foreman_maintain 1.4.3 → 1.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/definitions/checks/check_ipv6_disable.rb +23 -0
- data/definitions/checks/foreman_tasks/not_paused.rb +1 -1
- data/definitions/checks/katello_agent.rb +1 -3
- data/definitions/checks/package_manager/dnf/validate_dnf_config.rb +1 -1
- data/definitions/features/candlepin_database.rb +1 -1
- data/definitions/features/foreman_database.rb +1 -1
- data/definitions/features/installer.rb +0 -1
- data/definitions/features/pulpcore.rb +1 -1
- data/definitions/features/pulpcore_database.rb +1 -1
- data/definitions/features/service.rb +2 -2
- data/definitions/procedures/backup/offline/foreman_db.rb +1 -1
- data/definitions/procedures/backup/online/safety_confirmation.rb +1 -1
- data/definitions/procedures/backup/snapshot/mount_base.rb +1 -1
- data/definitions/procedures/foreman/fix_corrupted_roles.rb +1 -1
- data/definitions/procedures/maintenance_mode/is_enabled.rb +1 -1
- data/definitions/procedures/packages/check_for_reboot.rb +1 -1
- data/definitions/scenarios/backup.rb +1 -1
- data/definitions/scenarios/upgrade_to_capsule_6_15.rb +1 -0
- data/definitions/scenarios/upgrade_to_capsule_6_15_z.rb +1 -0
- data/definitions/scenarios/upgrade_to_satellite_6_15.rb +1 -0
- data/definitions/scenarios/upgrade_to_satellite_6_15_z.rb +1 -0
- data/lib/foreman_maintain/concerns/base_database.rb +1 -1
- data/lib/foreman_maintain/concerns/system_helpers.rb +1 -1
- data/lib/foreman_maintain/executable.rb +6 -2
- data/lib/foreman_maintain/reporter/cli_reporter.rb +3 -2
- data/lib/foreman_maintain/reporter.rb +1 -1
- data/lib/foreman_maintain/runner/execution.rb +4 -0
- data/lib/foreman_maintain/scenario.rb +8 -0
- data/lib/foreman_maintain/utils/service/abstract.rb +1 -1
- data/lib/foreman_maintain/version.rb +1 -1
- data/lib/foreman_maintain/yaml_storage.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2836a25289469db4359b751d6e55a250496d666f03d4b43973ed983291047c61
|
4
|
+
data.tar.gz: faad58b87f53102e5099d9c00253331168911d9babeff07945b0c5b08c5ff548
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90ce42b75b20231f9bebca160efc358d46b540f66d164aff924ef7e5f47ed97a15924ed59c471f744d1e79134955e060db0f31c66dfa09c7261f7bf6373d6a00
|
7
|
+
data.tar.gz: 28fe30e600d8e8ea00df96d77783b4f925c9e695bd376e000cdd43ecb1a3574ef4734ee0f7351c27b8c9ebf1d016834ed074f2faee589b6894883fd7802651e9
|
@@ -0,0 +1,23 @@
|
|
1
|
+
class Checks::CheckIpv6Disable < ForemanMaintain::Check
|
2
|
+
metadata do
|
3
|
+
label :check_ipv6_disable
|
4
|
+
description 'Check if ipv6.disable=1 is set at kernel level'
|
5
|
+
end
|
6
|
+
|
7
|
+
def run
|
8
|
+
cmdline_file = File.read('/proc/cmdline')
|
9
|
+
|
10
|
+
assert(!cmdline_file.include?("ipv6.disable=1"), error_message)
|
11
|
+
end
|
12
|
+
|
13
|
+
def error_message
|
14
|
+
base = "\nThe kernel contains ipv6.disable=1 which is known to break installation and upgrade"\
|
15
|
+
", remove and reboot before continuining."
|
16
|
+
|
17
|
+
if feature(:instance).downstream
|
18
|
+
base += " See https://access.redhat.com/solutions/5045841 for more details."
|
19
|
+
end
|
20
|
+
|
21
|
+
base
|
22
|
+
end
|
23
|
+
end
|
@@ -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)
|
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'yaml'
|
2
|
-
|
3
1
|
class Checks::CheckKatelloAgentEnabled < ForemanMaintain::Check
|
4
2
|
metadata do
|
5
3
|
label :check_katello_agent_enabled
|
@@ -7,7 +5,7 @@ class Checks::CheckKatelloAgentEnabled < ForemanMaintain::Check
|
|
7
5
|
tags :pre_upgrade
|
8
6
|
|
9
7
|
confine do
|
10
|
-
|
8
|
+
feature(:satellite) && feature(:satellite).current_minor_version == '6.14'
|
11
9
|
end
|
12
10
|
end
|
13
11
|
|
@@ -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]}"\
|
@@ -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
|
-
|
22
|
+
:instance_parent_unit => 'pulpcore-worker@')
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
@@ -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
|
@@ -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
|
@@ -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
|
-
|
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,
|
@@ -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
|
-
|
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
|
-
|
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
|
-
|
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
|
@@ -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
|
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.
|
4
|
+
version: 1.4.5
|
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:
|
11
|
+
date: 2024-05-14 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
|
@@ -444,7 +445,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
444
445
|
- !ruby/object:Gem::Version
|
445
446
|
version: '0'
|
446
447
|
requirements: []
|
447
|
-
rubygems_version: 3.3.
|
448
|
+
rubygems_version: 3.3.27
|
448
449
|
signing_key:
|
449
450
|
specification_version: 4
|
450
451
|
summary: Foreman maintenance tool belt
|