foreman_maintain 0.6.13 → 0.7.4
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/disk/available_space_candlepin.rb +27 -0
- data/definitions/checks/foreman/check_checkpoint_segments.rb +30 -22
- data/definitions/checks/foreman_tasks/not_paused.rb +10 -13
- data/definitions/checks/package_manager/yum/validate_yum_config.rb +51 -0
- data/definitions/features/candlepin.rb +4 -0
- data/definitions/features/dynflow_sidekiq.rb +7 -4
- data/definitions/features/foreman_cockpit.rb +15 -0
- data/definitions/features/foreman_tasks.rb +12 -2
- data/definitions/features/pulpcore.rb +20 -5
- data/definitions/procedures/backup/accessibility_confirmation.rb +1 -1
- data/definitions/procedures/backup/online/safety_confirmation.rb +11 -6
- 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 +2 -6
- data/definitions/procedures/content/prepare_abort.rb +12 -0
- data/definitions/procedures/content/switchover.rb +1 -1
- data/definitions/procedures/foreman_tasks/delete.rb +3 -4
- data/definitions/procedures/foreman_tasks/resume.rb +5 -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 +29 -0
- data/definitions/procedures/restore/confirmation.rb +1 -1
- data/definitions/procedures/restore/installer_reset.rb +10 -1
- data/definitions/procedures/service/list.rb +12 -2
- data/definitions/scenarios/backup.rb +2 -0
- 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 +3 -1
- data/lib/foreman_maintain/cli.rb +8 -0
- data/lib/foreman_maintain/cli/content_command.rb +17 -2
- data/lib/foreman_maintain/cli/upgrade_command.rb +2 -0
- data/lib/foreman_maintain/concerns/downstream.rb +4 -0
- data/lib/foreman_maintain/concerns/primary_checks.rb +23 -0
- data/lib/foreman_maintain/package_manager/dnf.rb +1 -0
- data/lib/foreman_maintain/reporter.rb +18 -13
- data/lib/foreman_maintain/reporter/cli_reporter.rb +24 -11
- data/lib/foreman_maintain/runner.rb +13 -8
- data/lib/foreman_maintain/scenario.rb +4 -0
- data/lib/foreman_maintain/utils/backup.rb +1 -1
- data/lib/foreman_maintain/utils/disk/io_device.rb +4 -0
- data/lib/foreman_maintain/utils/service/systemd.rb +13 -2
- data/lib/foreman_maintain/version.rb +1 -1
- metadata +14 -3
- data/definitions/checks/yum_exclude.rb +0 -21
@@ -116,6 +116,10 @@ module ForemanMaintain
|
|
116
116
|
filter_whitelisted(executed_steps.find_all(&:warning?), options)
|
117
117
|
end
|
118
118
|
|
119
|
+
def steps_with_skipped(options = {})
|
120
|
+
filter_whitelisted(executed_steps.find_all(&:skipped?), options)
|
121
|
+
end
|
122
|
+
|
119
123
|
def filter_whitelisted(steps, options)
|
120
124
|
options.validate_options!(:whitelisted)
|
121
125
|
if options.key?(:whitelisted)
|
@@ -163,7 +163,7 @@ module ForemanMaintain
|
|
163
163
|
def validate_hostname?
|
164
164
|
# make sure that the system hostname is the same as the backup
|
165
165
|
config_tarball = file_map[:config_files][:path]
|
166
|
-
tar_cmd = "tar zxf #{config_tarball} etc/httpd/conf/httpd.conf --to-stdout"
|
166
|
+
tar_cmd = "tar zxf #{config_tarball} etc/httpd/conf/httpd.conf --to-stdout --occurrence=1"
|
167
167
|
status, httpd_config = execute_with_status(tar_cmd)
|
168
168
|
|
169
169
|
# Incremental backups sometimes don't include httpd.conf. Since a "base" backup
|
@@ -22,6 +22,10 @@ module ForemanMaintain
|
|
22
22
|
convert_kb_to_mb(execute!("df #{dir}|awk {'print $4'}|tail -1").to_i)
|
23
23
|
end
|
24
24
|
|
25
|
+
def space_used_in_percent
|
26
|
+
execute!("df #{dir}|awk {'print $5'}|tail -1").to_i
|
27
|
+
end
|
28
|
+
|
25
29
|
private
|
26
30
|
|
27
31
|
# In fio command, --direct option bypass the cache page
|
@@ -1,16 +1,17 @@
|
|
1
1
|
module ForemanMaintain::Utils
|
2
2
|
module Service
|
3
3
|
class Systemd < Abstract
|
4
|
+
attr_reader :instance_parent_unit
|
4
5
|
def initialize(name, priority, options = {})
|
5
6
|
super
|
6
7
|
@sys = SystemHelpers.new
|
8
|
+
@instance_parent_unit = options.fetch(:instance_parent_unit, nil)
|
7
9
|
end
|
8
10
|
|
9
11
|
def command(action, options = {})
|
10
12
|
do_wait = options.fetch(:wait, true) # wait for service to start
|
11
13
|
all = @options.fetch(:all, false)
|
12
14
|
skip_enablement = @options.fetch(:skip_enablement, false)
|
13
|
-
|
14
15
|
if skip_enablement && %w[enable disable].include?(action)
|
15
16
|
return skip_enablement_message(action, @name)
|
16
17
|
end
|
@@ -50,19 +51,29 @@ module ForemanMaintain::Utils
|
|
50
51
|
|
51
52
|
def exist?
|
52
53
|
if @sys.systemd_installed?
|
53
|
-
systemd =
|
54
|
+
systemd = service_enabled_status
|
54
55
|
systemd == 'enabled' || systemd == 'disabled'
|
55
56
|
else
|
56
57
|
File.exist?("/etc/init.d/#{@name}")
|
57
58
|
end
|
58
59
|
end
|
59
60
|
|
61
|
+
def enabled?
|
62
|
+
if @sys.systemd_installed?
|
63
|
+
service_enabled_status == 'enabled'
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
60
67
|
private
|
61
68
|
|
62
69
|
def execute(action, options = {})
|
63
70
|
@sys.execute_with_status(command(action, options))
|
64
71
|
end
|
65
72
|
|
73
|
+
def service_enabled_status
|
74
|
+
@sys.execute("systemctl is-enabled #{@name} 2>&1 | tail -1").strip
|
75
|
+
end
|
76
|
+
|
66
77
|
def skip_enablement_message(action, name)
|
67
78
|
# Enable and disable does not work well with globs since they treat them literally.
|
68
79
|
# We are skipping the pulpcore-workers@* for these actions until they are configured in
|
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: 0.
|
4
|
+
version: 0.7.4
|
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: 2021-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: clamp
|
@@ -125,6 +125,7 @@ files:
|
|
125
125
|
- definitions/checks/check_hotfix_installed.rb
|
126
126
|
- definitions/checks/check_tmout.rb
|
127
127
|
- definitions/checks/disk/available_space.rb
|
128
|
+
- definitions/checks/disk/available_space_candlepin.rb
|
128
129
|
- definitions/checks/disk/performance.rb
|
129
130
|
- definitions/checks/env_proxy.rb
|
130
131
|
- definitions/checks/foreman/check_checkpoint_segments.rb
|
@@ -147,6 +148,7 @@ files:
|
|
147
148
|
- definitions/checks/mongo/db_up.rb
|
148
149
|
- definitions/checks/mongo/tools_installed.rb
|
149
150
|
- definitions/checks/original_assets.rb
|
151
|
+
- definitions/checks/package_manager/yum/validate_yum_config.rb
|
150
152
|
- definitions/checks/pulpcore/db_up.rb
|
151
153
|
- definitions/checks/puppet/provide_upgrade_guide.rb
|
152
154
|
- definitions/checks/puppet/verify_no_empty_cacert_requests.rb
|
@@ -161,7 +163,6 @@ files:
|
|
161
163
|
- definitions/checks/services_up.rb
|
162
164
|
- definitions/checks/system_registration.rb
|
163
165
|
- definitions/checks/version_locking_enabled.rb
|
164
|
-
- definitions/checks/yum_exclude.rb
|
165
166
|
- definitions/features/apache.rb
|
166
167
|
- definitions/features/candlepin.rb
|
167
168
|
- definitions/features/candlepin_database.rb
|
@@ -170,6 +171,7 @@ files:
|
|
170
171
|
- definitions/features/dynflow_sidekiq.rb
|
171
172
|
- definitions/features/foreman_1_11_x.rb
|
172
173
|
- definitions/features/foreman_1_7_x.rb
|
174
|
+
- definitions/features/foreman_cockpit.rb
|
173
175
|
- definitions/features/foreman_database.rb
|
174
176
|
- definitions/features/foreman_openscap.rb
|
175
177
|
- definitions/features/foreman_proxy.rb
|
@@ -220,7 +222,9 @@ files:
|
|
220
222
|
- definitions/procedures/backup/snapshot/mount_pulpcore_db.rb
|
221
223
|
- definitions/procedures/backup/snapshot/prepare_mount.rb
|
222
224
|
- definitions/procedures/candlepin/delete_orphaned_records_from_env_content.rb
|
225
|
+
- definitions/procedures/content/migration_stats.rb
|
223
226
|
- definitions/procedures/content/prepare.rb
|
227
|
+
- definitions/procedures/content/prepare_abort.rb
|
224
228
|
- definitions/procedures/content/switchover.rb
|
225
229
|
- definitions/procedures/crond/start.rb
|
226
230
|
- definitions/procedures/crond/stop.rb
|
@@ -253,6 +257,7 @@ files:
|
|
253
257
|
- definitions/procedures/packages/update.rb
|
254
258
|
- definitions/procedures/packages/update_all_confirmation.rb
|
255
259
|
- definitions/procedures/passenger_recycler.rb
|
260
|
+
- definitions/procedures/prep_6_10_upgrade.rb
|
256
261
|
- definitions/procedures/pulp/migrate.rb
|
257
262
|
- definitions/procedures/pulpcore/migrate.rb
|
258
263
|
- definitions/procedures/puppet/delete_empty_ca_cert_request_files.rb
|
@@ -288,10 +293,13 @@ files:
|
|
288
293
|
- definitions/scenarios/content.rb
|
289
294
|
- definitions/scenarios/maintenance_mode.rb
|
290
295
|
- definitions/scenarios/packages.rb
|
296
|
+
- definitions/scenarios/prep_6_10_upgrade.rb
|
291
297
|
- definitions/scenarios/restore.rb
|
292
298
|
- definitions/scenarios/services.rb
|
293
299
|
- definitions/scenarios/upgrade_to_capsule_6_8.rb
|
294
300
|
- definitions/scenarios/upgrade_to_capsule_6_8_z.rb
|
301
|
+
- definitions/scenarios/upgrade_to_capsule_6_9.rb
|
302
|
+
- definitions/scenarios/upgrade_to_capsule_6_9_z.rb
|
295
303
|
- definitions/scenarios/upgrade_to_satellite_6_2.rb
|
296
304
|
- definitions/scenarios/upgrade_to_satellite_6_2_z.rb
|
297
305
|
- definitions/scenarios/upgrade_to_satellite_6_3.rb
|
@@ -306,6 +314,8 @@ files:
|
|
306
314
|
- definitions/scenarios/upgrade_to_satellite_6_7_z.rb
|
307
315
|
- definitions/scenarios/upgrade_to_satellite_6_8.rb
|
308
316
|
- definitions/scenarios/upgrade_to_satellite_6_8_z.rb
|
317
|
+
- definitions/scenarios/upgrade_to_satellite_6_9.rb
|
318
|
+
- definitions/scenarios/upgrade_to_satellite_6_9_z.rb
|
309
319
|
- extras/foreman-maintain.sh
|
310
320
|
- extras/foreman_protector/foreman-protector.conf
|
311
321
|
- extras/foreman_protector/foreman-protector.py
|
@@ -338,6 +348,7 @@ files:
|
|
338
348
|
- lib/foreman_maintain/concerns/hammer.rb
|
339
349
|
- lib/foreman_maintain/concerns/logger.rb
|
340
350
|
- lib/foreman_maintain/concerns/metadata.rb
|
351
|
+
- lib/foreman_maintain/concerns/primary_checks.rb
|
341
352
|
- lib/foreman_maintain/concerns/reporter.rb
|
342
353
|
- lib/foreman_maintain/concerns/scenario_metadata.rb
|
343
354
|
- lib/foreman_maintain/concerns/system_helpers.rb
|
@@ -1,21 +0,0 @@
|
|
1
|
-
class Checks::YumExclude < ForemanMaintain::Check
|
2
|
-
metadata do
|
3
|
-
label :check_yum_exclude_list
|
4
|
-
description 'Check if yum exclude list is configured'
|
5
|
-
tags :pre_upgrade
|
6
|
-
end
|
7
|
-
|
8
|
-
EXCLUDE_SET_RE = /^exclude\s*=\s*\S+.*$/
|
9
|
-
|
10
|
-
def run
|
11
|
-
grep_result = grep_yum_exclude
|
12
|
-
assert(!grep_result.match(EXCLUDE_SET_RE),
|
13
|
-
'The /etc/yum.conf has exclude list configured as below,'\
|
14
|
-
"\n #{grep_result}"\
|
15
|
-
"\nUnset this as it can cause yum update or upgrade failures !")
|
16
|
-
end
|
17
|
-
|
18
|
-
def grep_yum_exclude
|
19
|
-
execute_with_status('grep -w exclude /etc/yum.conf')[1]
|
20
|
-
end
|
21
|
-
end
|