foreman_maintain 0.8.20 → 0.8.21
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/definitions/checks/check_for_newer_packages.rb +5 -3
- data/definitions/checks/disk/performance.rb +19 -8
- data/definitions/features/foreman_tasks.rb +11 -0
- data/definitions/procedures/content/prepare.rb +1 -1
- data/lib/foreman_maintain/concerns/el_repos_manager_common.rb +20 -0
- data/lib/foreman_maintain/repos_manager/dnf_config_manager.rb +13 -0
- data/lib/foreman_maintain/repos_manager/el_common.rb +0 -0
- data/lib/foreman_maintain/repos_manager/yum_config_manager.rb +20 -0
- data/lib/foreman_maintain/utils/command_runner.rb +2 -1
- data/lib/foreman_maintain/version.rb +1 -1
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34a580f07f36c4c9ab021f465d02b0430ac81a444765f2793a7940d18182ce25
|
4
|
+
data.tar.gz: ef70e629eec6f635d2515b9eea748567c2d3e559fc762a3005a0ab9a85d7e61b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0797ffb2141b60a5811f62dcdddb2d600221c22df75868674a4628838a445836058b003d67296bc91a2bc4593f06dbe4bcd1223417263fb9335d4bb141dc8c14'
|
7
|
+
data.tar.gz: a40dd53e0d8633bd01301e2b85b2d38cf62d8ca0ab502c9c3747939d5a7b38f3fc90fc6b8f861ec956846660ab6ac0a22e2c257e3c07c3963fec945ee03cadde
|
@@ -33,9 +33,11 @@ class Checks::CheckForNewerPackages < ForemanMaintain::Check
|
|
33
33
|
end
|
34
34
|
|
35
35
|
unless packages_with_updates.empty?
|
36
|
-
|
37
|
-
|
38
|
-
|
36
|
+
command = ForemanMaintain.pkg_and_cmd_name[1]
|
37
|
+
fail! 'Required updates for some packages detected.'\
|
38
|
+
"\nPlease update to the latest #{@manual_confirmation_version}.z release "\
|
39
|
+
'before proceeding, using:'\
|
40
|
+
"\n# #{command} upgrade run --target-version #{@manual_confirmation_version}.z"
|
39
41
|
end
|
40
42
|
end
|
41
43
|
|
@@ -39,8 +39,8 @@ module Checks
|
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
|
-
def
|
43
|
-
@
|
42
|
+
def data_dirs
|
43
|
+
@data_dirs ||= %i[pulpcore_database mongo foreman_database].inject({}) do |dirs, f|
|
44
44
|
if feature(f) && File.directory?(feature(f).data_dir)
|
45
45
|
dirs[feature(f).label_dashed] = feature(f).data_dir
|
46
46
|
end
|
@@ -48,20 +48,32 @@ module Checks
|
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
51
|
+
def pulp_dir
|
52
|
+
@pulp_dir ||= begin
|
53
|
+
pulp_feature = feature(:pulp2) || feature(:pulpcore_database)
|
54
|
+
{ pulp_feature.label_dashed => pulp_feature.pulp_data_dir }
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
51
58
|
def description
|
52
|
-
|
59
|
+
'Check recommended disk speed for '\
|
60
|
+
"#{[data_dirs.keys | pulp_dir.keys].join(', ')} directories."
|
61
|
+
end
|
62
|
+
|
63
|
+
def all_dirs
|
64
|
+
data_dirs.values | pulp_dir.values
|
53
65
|
end
|
54
66
|
|
55
67
|
def check_only_single_device?
|
56
|
-
|
68
|
+
all_dirs.each do |dir|
|
57
69
|
ForemanMaintain::Utils::Disk::Device.new(dir).name
|
58
70
|
end.uniq.length <= 1
|
59
71
|
end
|
60
72
|
|
61
73
|
def dirs_to_check
|
62
|
-
return
|
74
|
+
return all_dirs.first(1) if check_only_single_device?
|
63
75
|
|
64
|
-
|
76
|
+
all_dirs
|
65
77
|
end
|
66
78
|
|
67
79
|
private
|
@@ -74,11 +86,10 @@ module Checks
|
|
74
86
|
def compute_disk_speed(spinner)
|
75
87
|
success = true
|
76
88
|
io_obj = ForemanMaintain::Utils::Disk::NilDevice.new
|
77
|
-
|
78
89
|
dirs_to_check.each do |dir|
|
79
90
|
io_obj = ForemanMaintain::Utils::Disk::Device.new(dir)
|
80
91
|
|
81
|
-
spinner.update("[Speed check In-Progress] device
|
92
|
+
spinner.update("[Speed check In-Progress] device:#{io_obj.name}")
|
82
93
|
stats << io_obj
|
83
94
|
|
84
95
|
next if io_obj.read_speed >= EXPECTED_IO
|
@@ -17,6 +17,17 @@ class Features::ForemanTasks < ForemanMaintain::Feature
|
|
17
17
|
Actions::Candlepin::ListenOnCandlepinEvents
|
18
18
|
Actions::Katello::EventQueue::Monitor
|
19
19
|
Actions::Insights::EmailPoller
|
20
|
+
ForemanInventoryUpload::Async::GenerateReportJob
|
21
|
+
ForemanInventoryUpload::Async::QueueForUploadJob
|
22
|
+
ForemanInventoryUpload::Async::UploadReportJob
|
23
|
+
InsightsCloud::Async::InsightsClientStatusAging
|
24
|
+
InsightsCloud::Async::InsightsFullSync
|
25
|
+
InsightsCloud::Async::InsightsResolutionsSync
|
26
|
+
InsightsCloud::Async::InsightsRulesSync
|
27
|
+
InventorySync::Async::InventoryFullSync
|
28
|
+
InventorySync::Async::InventoryHostsSync
|
29
|
+
InventorySync::Async::InventoryScheduledSync
|
30
|
+
InventorySync::Async::InventorySelfHostSync
|
20
31
|
].freeze
|
21
32
|
|
22
33
|
metadata do
|
@@ -10,7 +10,7 @@ module Procedures::Content
|
|
10
10
|
sleep(20) # in satellite 6.9 the services are still coming up
|
11
11
|
# use interactive to get realtime output
|
12
12
|
env_vars = @quiet ? '' : 'preserve_output=true '
|
13
|
-
|
13
|
+
execute!("#{env_vars}foreman-rake katello:pulp3_migration", :interactive => true)
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module ForemanMaintain
|
2
|
+
module Concerns
|
3
|
+
module ElReposManagerCommon
|
4
|
+
include ForemanMaintain::Concerns::OsFacts
|
5
|
+
|
6
|
+
def package_manager
|
7
|
+
return 'dnf' if el8?
|
8
|
+
|
9
|
+
'yum'
|
10
|
+
end
|
11
|
+
|
12
|
+
def enabled_repos_hash
|
13
|
+
repos = execute("#{package_manager} repolist enabled -d 6 -e 0 2> /dev/null | grep -E 'Repo-id|Repo-baseurl'")
|
14
|
+
return {} if repos.empty?
|
15
|
+
|
16
|
+
Hash[*repos.delete!(' ').split("\n")]
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module ForemanMaintain::ReposManager
|
2
|
+
class DnfConfigManager
|
3
|
+
include ForemanMaintain::Concerns::ElReposManagerCommon
|
4
|
+
|
5
|
+
def disable_repos(repo_ids)
|
6
|
+
execute!("dnf config-manager --set-disabled #{repo_ids.join(',')}")
|
7
|
+
end
|
8
|
+
|
9
|
+
def enable_repos(repo_ids)
|
10
|
+
execute!("dnf config-manager --set-enabled #{repo_ids.join(',')}")
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
File without changes
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module ForemanMaintain::ReposManager
|
2
|
+
class YumConfigManager
|
3
|
+
include ForemanMaintain::Concerns::ElReposManagerCommon
|
4
|
+
|
5
|
+
def disable_repos(repo_ids)
|
6
|
+
execute!("yum-config-manager --disable #{repo_ids.join(',')}")
|
7
|
+
end
|
8
|
+
|
9
|
+
def enable_repos(repo_ids)
|
10
|
+
execute!("yum-config-manager --enable #{repo_ids.join(',')}")
|
11
|
+
end
|
12
|
+
|
13
|
+
def enabled_repos_hash
|
14
|
+
repos = execute("yum repolist enabled -d 6 -e 0 2> /dev/null | grep -E 'Repo-id|Repo-baseurl'")
|
15
|
+
return {} if repos.empty?
|
16
|
+
|
17
|
+
Hash[*repos.delete!(' ').split("\n")]
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -66,7 +66,8 @@ module ForemanMaintain
|
|
66
66
|
log_file = Tempfile.open('captured-output')
|
67
67
|
exit_file = Tempfile.open('captured-exit-code')
|
68
68
|
Kernel.system(
|
69
|
-
"bash -c '#{full_command}; echo $? > #{exit_file.path}'
|
69
|
+
"stdbuf -oL -eL bash -c '#{full_command}; echo $? > #{exit_file.path}'"\
|
70
|
+
"| tee -i #{log_file.path}"
|
70
71
|
)
|
71
72
|
File.open(log_file.path) { |f| @output = f.read }
|
72
73
|
File.open(exit_file.path) do |f|
|
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.8.
|
4
|
+
version: 0.8.21
|
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: 2021-
|
11
|
+
date: 2021-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: clamp
|
@@ -359,6 +359,7 @@ files:
|
|
359
359
|
- lib/foreman_maintain/concerns/base_database.rb
|
360
360
|
- lib/foreman_maintain/concerns/directory_marker.rb
|
361
361
|
- lib/foreman_maintain/concerns/downstream.rb
|
362
|
+
- lib/foreman_maintain/concerns/el_repos_manager_common.rb
|
362
363
|
- lib/foreman_maintain/concerns/finders.rb
|
363
364
|
- lib/foreman_maintain/concerns/hammer.rb
|
364
365
|
- lib/foreman_maintain/concerns/logger.rb
|
@@ -386,6 +387,9 @@ files:
|
|
386
387
|
- lib/foreman_maintain/procedure.rb
|
387
388
|
- lib/foreman_maintain/reporter.rb
|
388
389
|
- lib/foreman_maintain/reporter/cli_reporter.rb
|
390
|
+
- lib/foreman_maintain/repos_manager/dnf_config_manager.rb
|
391
|
+
- lib/foreman_maintain/repos_manager/el_common.rb
|
392
|
+
- lib/foreman_maintain/repos_manager/yum_config_manager.rb
|
389
393
|
- lib/foreman_maintain/runner.rb
|
390
394
|
- lib/foreman_maintain/runner/execution.rb
|
391
395
|
- lib/foreman_maintain/runner/stored_execution.rb
|