foreman_maintain 1.13.6 → 1.13.8
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_subscription_manager_release.rb +41 -0
- data/definitions/features/rh_cloud.rb +19 -0
- data/definitions/reports/rh_cloud.rb +104 -0
- data/definitions/scenarios/satellite_upgrade.rb +1 -0
- data/definitions/scenarios/update.rb +1 -0
- data/lib/foreman_maintain/version.rb +1 -1
- metadata +9 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 971f7d2897d25c93c6572cc408ea39b6405ab7e415806177905c8ea383c5a525
|
|
4
|
+
data.tar.gz: c4ddc2fa82aa1cf316e9029163b009ef4a8d6a5eae80968f4648f9ddd17d0331
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e72af4ddedfb3935e465d049accdea46aa4c9eb705c2ae62d5a1f0f60f3a8888847b3c38764b54fc3c2e67eeea898419c53848679dce781d92964efb5820d3aa
|
|
7
|
+
data.tar.gz: a52018932321bb92974c3e6ca4b3dd0fd0acded1394c63b66033c43d8e45ae0db408843bd6389a72e1e127faf0d2648c6ec3308f7f1528eb0828eb375c9117b4
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
class Checks::CheckSubscriptionManagerRelease < ForemanMaintain::Check
|
|
2
|
+
metadata do
|
|
3
|
+
label :check_subscription_manager_release
|
|
4
|
+
description 'Check if subscription-manager release is not set to a minor version'
|
|
5
|
+
|
|
6
|
+
confine do
|
|
7
|
+
feature(:instance).downstream
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def run
|
|
12
|
+
status, output = execute_with_status('LC_ALL=C subscription-manager release --show')
|
|
13
|
+
|
|
14
|
+
# If command fails (subscription-manager not installed or system not registered), pass the check
|
|
15
|
+
return if status != 0
|
|
16
|
+
|
|
17
|
+
assert(valid_release?(output), error_message(output))
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
private
|
|
21
|
+
|
|
22
|
+
def valid_release?(output)
|
|
23
|
+
# Valid formats: "Release not set" or "Release: X" where X is a major version without dots
|
|
24
|
+
return true if output == 'Release not set'
|
|
25
|
+
return true if /^Release:\s+\d+$/.match?(output)
|
|
26
|
+
|
|
27
|
+
false
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def extract_release(output)
|
|
31
|
+
match = output.match(/^Release:\s+(.+)$/)
|
|
32
|
+
match ? match[1] : output
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def error_message(output)
|
|
36
|
+
subman_release = extract_release(output)
|
|
37
|
+
"Your system is configured to use RHEL #{subman_release}, but Satellite is only "\
|
|
38
|
+
"supported on the latest RHEL. Please unset the release in subscription-manager by "\
|
|
39
|
+
"calling `subscription-manager release --unset`."
|
|
40
|
+
end
|
|
41
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
class Features::RhCloud < ForemanMaintain::Feature
|
|
2
|
+
include ForemanMaintain::Concerns::Versions
|
|
3
|
+
|
|
4
|
+
metadata do
|
|
5
|
+
label :rh_cloud
|
|
6
|
+
|
|
7
|
+
confine do
|
|
8
|
+
find_package(foreman_plugin_name('foreman_rh_cloud'))
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def current_version
|
|
13
|
+
@current_version ||= package_version(package_name)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def package_name
|
|
17
|
+
foreman_plugin_name('foreman_rh_cloud')
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
module Reports
|
|
2
|
+
class Rhcloud < ForemanMaintain::Report
|
|
3
|
+
metadata do
|
|
4
|
+
description 'Check if rh_cloud is enabled and what features are in use'
|
|
5
|
+
confine do
|
|
6
|
+
feature(:rh_cloud)
|
|
7
|
+
end
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
# rubocop:disable Metrics/MethodLength
|
|
11
|
+
def run
|
|
12
|
+
data_field('rh_cloud_hosts_count') do
|
|
13
|
+
rh_cloud_hosts_count
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
data_field('rh_cloud_mismatched_hosts_count') do
|
|
17
|
+
rh_cloud_mismatched_hosts_count
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
data_field('rh_cloud_total_hits') do
|
|
21
|
+
rh_cloud_total_hits
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
data_field('rh_cloud_mismatched_auto_delete') do
|
|
25
|
+
rh_cloud_mismatched_auto_delete
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
data_field('rh_cloud_obfuscate_inventory_hostnames') do
|
|
29
|
+
obfuscate_inventory_hostnames_setting
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
data_field('rh_cloud_obfuscate_inventory_ips') do
|
|
33
|
+
obfuscate_inventory_ips_setting
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
data_field('rh_cloud_minimal_data_collection') do
|
|
37
|
+
minimal_data_collection
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
data_field('rh_cloud_exclude_host_package_info') do
|
|
41
|
+
exclude_host_package_info
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
data_field('rh_cloud_connector_enabled') do
|
|
45
|
+
cloud_connector_enabled
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
data_field('rh_cloud_inventory_upload_enabled') do
|
|
49
|
+
inventory_upload_enabled
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
data_field('rh_cloud_recommendations_sync_enabled') do
|
|
53
|
+
recommendations_sync_enabled
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
# rubocop:enable Metrics/MethodLength
|
|
57
|
+
|
|
58
|
+
private
|
|
59
|
+
|
|
60
|
+
def rh_cloud_hosts_count
|
|
61
|
+
sql_count('hosts INNER JOIN insights_facets ON hosts.id = insights_facets.host_id')
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def rh_cloud_mismatched_hosts_count
|
|
65
|
+
sql_count('insights_missing_hosts')
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
def rh_cloud_total_hits
|
|
69
|
+
sql_count('hosts INNER JOIN insights_hits ON hosts.id = insights_hits.host_id')
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
def obfuscate_inventory_hostnames_setting
|
|
73
|
+
!!sql_setting('obfuscate_inventory_hostnames')
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
def obfuscate_inventory_ips_setting
|
|
77
|
+
!!sql_setting('obfuscate_inventory_ips')
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
def minimal_data_collection
|
|
81
|
+
!!sql_setting('insights_minimal_data_collection')
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
def exclude_host_package_info
|
|
85
|
+
!!sql_setting('exclude_installed_packages')
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
def rh_cloud_mismatched_auto_delete
|
|
89
|
+
!!sql_setting('allow_auto_insights_mismatch_delete')
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
def cloud_connector_enabled
|
|
93
|
+
!!sql_setting('rhc_instance_id')
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
def inventory_upload_enabled
|
|
97
|
+
!sql_setting('allow_auto_inventory_upload')
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
def recommendations_sync_enabled
|
|
101
|
+
!sql_setting('allow_auto_insights_sync')
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
end
|
|
@@ -35,6 +35,7 @@ module Scenarios::Satellite
|
|
|
35
35
|
Checks::SystemRegistration,
|
|
36
36
|
Checks::CheckHotfixInstalled,
|
|
37
37
|
Checks::CheckTmout,
|
|
38
|
+
Checks::CheckSubscriptionManagerRelease,
|
|
38
39
|
Checks::CheckUpstreamRepository,
|
|
39
40
|
Checks::Container::PodmanLogin, # if downstream, connected, containers used
|
|
40
41
|
Checks::Disk::AvailableSpace,
|
|
@@ -33,6 +33,7 @@ module Scenarios::Update
|
|
|
33
33
|
Checks::SystemRegistration,
|
|
34
34
|
Checks::CheckHotfixInstalled,
|
|
35
35
|
Checks::CheckTmout,
|
|
36
|
+
Checks::CheckSubscriptionManagerRelease,
|
|
36
37
|
Checks::CheckIpv6Disable,
|
|
37
38
|
Checks::CheckUpstreamRepository,
|
|
38
39
|
Checks::Container::PodmanLogin, # if downstream, connected, containers used
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: foreman_maintain
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.13.
|
|
4
|
+
version: 1.13.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ivan Nečas
|
|
@@ -55,16 +55,16 @@ dependencies:
|
|
|
55
55
|
name: minitest
|
|
56
56
|
requirement: !ruby/object:Gem::Requirement
|
|
57
57
|
requirements:
|
|
58
|
-
- - "
|
|
58
|
+
- - "~>"
|
|
59
59
|
- !ruby/object:Gem::Version
|
|
60
|
-
version: '0'
|
|
60
|
+
version: '5.0'
|
|
61
61
|
type: :development
|
|
62
62
|
prerelease: false
|
|
63
63
|
version_requirements: !ruby/object:Gem::Requirement
|
|
64
64
|
requirements:
|
|
65
|
-
- - "
|
|
65
|
+
- - "~>"
|
|
66
66
|
- !ruby/object:Gem::Version
|
|
67
|
-
version: '0'
|
|
67
|
+
version: '5.0'
|
|
68
68
|
- !ruby/object:Gem::Dependency
|
|
69
69
|
name: minitest-reporters
|
|
70
70
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -161,6 +161,7 @@ files:
|
|
|
161
161
|
- definitions/checks/check_hotfix_installed.rb
|
|
162
162
|
- definitions/checks/check_ipv6_disable.rb
|
|
163
163
|
- definitions/checks/check_sha1_certificate_authority.rb
|
|
164
|
+
- definitions/checks/check_subscription_manager_release.rb
|
|
164
165
|
- definitions/checks/check_tmout.rb
|
|
165
166
|
- definitions/checks/container/podman_login.rb
|
|
166
167
|
- definitions/checks/disk/available_space.rb
|
|
@@ -240,6 +241,7 @@ files:
|
|
|
240
241
|
- definitions/features/pulpcore_database.rb
|
|
241
242
|
- definitions/features/puppet_server.rb
|
|
242
243
|
- definitions/features/redis.rb
|
|
244
|
+
- definitions/features/rh_cloud.rb
|
|
243
245
|
- definitions/features/salt_server.rb
|
|
244
246
|
- definitions/features/satellite.rb
|
|
245
247
|
- definitions/features/service.rb
|
|
@@ -355,6 +357,7 @@ files:
|
|
|
355
357
|
- definitions/reports/provisioning.rb
|
|
356
358
|
- definitions/reports/rbac.rb
|
|
357
359
|
- definitions/reports/recurring_logics.rb
|
|
360
|
+
- definitions/reports/rh_cloud.rb
|
|
358
361
|
- definitions/reports/selinux.rb
|
|
359
362
|
- definitions/reports/template
|
|
360
363
|
- definitions/reports/virt_who.rb
|
|
@@ -487,7 +490,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
487
490
|
- !ruby/object:Gem::Version
|
|
488
491
|
version: '0'
|
|
489
492
|
requirements: []
|
|
490
|
-
rubygems_version:
|
|
493
|
+
rubygems_version: 4.0.6
|
|
491
494
|
specification_version: 4
|
|
492
495
|
summary: Foreman maintenance tool belt
|
|
493
496
|
test_files: []
|