foreman_maintain 1.13.8 → 1.14.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.
- checksums.yaml +4 -4
- data/definitions/checks/foreman/check_corrupted_roles.rb +1 -3
- data/definitions/features/iop.rb +1 -0
- data/definitions/procedures/foreman/fix_corrupted_roles.rb +6 -7
- data/definitions/scenarios/foreman_upgrade.rb +0 -1
- data/definitions/scenarios/satellite_upgrade.rb +0 -2
- data/definitions/scenarios/update.rb +0 -1
- data/lib/foreman_maintain/version.rb +1 -1
- metadata +6 -9
- data/definitions/checks/check_subscription_manager_release.rb +0 -41
- data/definitions/features/rh_cloud.rb +0 -19
- data/definitions/reports/rh_cloud.rb +0 -104
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 580f9ed6daf35b7d33e6882ed898e6f9e157cf2c1624d41d00b59307f946100f
|
|
4
|
+
data.tar.gz: ee891a1e0626efd104d723c5e1238aba4646e98b2ba3f2f4c1f6ad18fa6b5360
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1061e9ed5bf86aeb1e06f7443be45ba4537f09f7c098becfca7d525494b7bd8dcbe48fb0b3d8a1fd93e2bd902d46d721101006090f02cafd9c6bd6b25cf0631a
|
|
7
|
+
data.tar.gz: a4901ffda5a1ed71dabf18efd1910a4505713b946400bec86f76a9cd5e4338357afec55b41f758fd2a7ccc2f3c94c55e0b0cdde4fc639fa3a6dd5a9633f933f0
|
|
@@ -32,7 +32,6 @@ module Checks
|
|
|
32
32
|
filters.role_id,
|
|
33
33
|
filters.search,
|
|
34
34
|
filters.taxonomy_search,
|
|
35
|
-
filters.override,
|
|
36
35
|
filterings.id AS filtering_id,
|
|
37
36
|
permissions.id AS permission_id,
|
|
38
37
|
permissions.name AS permission_name,
|
|
@@ -52,8 +51,7 @@ module Checks
|
|
|
52
51
|
first.permission_name,
|
|
53
52
|
first.resource_type,
|
|
54
53
|
first.search,
|
|
55
|
-
first.taxonomy_search
|
|
56
|
-
first.override
|
|
54
|
+
first.taxonomy_search
|
|
57
55
|
FROM (#{subquery}) first JOIN (#{subquery}) second
|
|
58
56
|
ON first.filter_id = second.filter_id AND
|
|
59
57
|
((first.resource_type IS NOT NULL AND second.resource_type IS NULL)
|
data/definitions/features/iop.rb
CHANGED
|
@@ -34,8 +34,7 @@ module Procedures::Foreman
|
|
|
34
34
|
def update_records(set)
|
|
35
35
|
new_filter = create_filter set.first['role_id'],
|
|
36
36
|
set.first['search'],
|
|
37
|
-
set.first['taxonomy_search']
|
|
38
|
-
set.first['override']
|
|
37
|
+
set.first['taxonomy_search']
|
|
39
38
|
set.each do |item|
|
|
40
39
|
destroy_filtering item
|
|
41
40
|
next if !new_filter || new_filter.empty?
|
|
@@ -43,9 +42,9 @@ module Procedures::Foreman
|
|
|
43
42
|
end
|
|
44
43
|
end
|
|
45
44
|
|
|
46
|
-
def create_filter(role_id, search, taxonomy_search
|
|
45
|
+
def create_filter(role_id, search, taxonomy_search)
|
|
47
46
|
feature(:foreman_database).query(
|
|
48
|
-
create_filter_query(search, role_id, taxonomy_search
|
|
47
|
+
create_filter_query(search, role_id, taxonomy_search)
|
|
49
48
|
).first
|
|
50
49
|
end
|
|
51
50
|
|
|
@@ -53,11 +52,11 @@ module Procedures::Foreman
|
|
|
53
52
|
value ? "'#{value}'" : 'NULL'
|
|
54
53
|
end
|
|
55
54
|
|
|
56
|
-
def create_filter_query(search, role_id, taxonomy_search
|
|
55
|
+
def create_filter_query(search, role_id, taxonomy_search)
|
|
57
56
|
<<-SQL
|
|
58
57
|
WITH rows AS (
|
|
59
|
-
INSERT INTO filters (search, role_id, taxonomy_search,
|
|
60
|
-
VALUES (#{escape_val(search)}, #{role_id}, #{escape_val(taxonomy_search)}, '#{
|
|
58
|
+
INSERT INTO filters (search, role_id, taxonomy_search, created_at, updated_at)
|
|
59
|
+
VALUES (#{escape_val(search)}, #{role_id}, #{escape_val(taxonomy_search)}, '#{Time.now}', '#{Time.now}')
|
|
61
60
|
RETURNING id
|
|
62
61
|
)
|
|
63
62
|
SELECT id
|
|
@@ -35,7 +35,6 @@ module Scenarios::Satellite
|
|
|
35
35
|
Checks::SystemRegistration,
|
|
36
36
|
Checks::CheckHotfixInstalled,
|
|
37
37
|
Checks::CheckTmout,
|
|
38
|
-
Checks::CheckSubscriptionManagerRelease,
|
|
39
38
|
Checks::CheckUpstreamRepository,
|
|
40
39
|
Checks::Container::PodmanLogin, # if downstream, connected, containers used
|
|
41
40
|
Checks::Disk::AvailableSpace,
|
|
@@ -116,7 +115,6 @@ module Scenarios::Satellite
|
|
|
116
115
|
add_steps(
|
|
117
116
|
Procedures::RefreshFeatures,
|
|
118
117
|
Procedures::Service::Start,
|
|
119
|
-
Procedures::Pulpcore::RpmDatarepair,
|
|
120
118
|
Procedures::Crond::Start,
|
|
121
119
|
Procedures::Timer::Start,
|
|
122
120
|
Procedures::SyncPlans::Enable,
|
|
@@ -33,7 +33,6 @@ module Scenarios::Update
|
|
|
33
33
|
Checks::SystemRegistration,
|
|
34
34
|
Checks::CheckHotfixInstalled,
|
|
35
35
|
Checks::CheckTmout,
|
|
36
|
-
Checks::CheckSubscriptionManagerRelease,
|
|
37
36
|
Checks::CheckIpv6Disable,
|
|
38
37
|
Checks::CheckUpstreamRepository,
|
|
39
38
|
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.
|
|
4
|
+
version: 1.14.0
|
|
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: '
|
|
60
|
+
version: '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: '
|
|
67
|
+
version: '0'
|
|
68
68
|
- !ruby/object:Gem::Dependency
|
|
69
69
|
name: minitest-reporters
|
|
70
70
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -161,7 +161,6 @@ 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
|
|
165
164
|
- definitions/checks/check_tmout.rb
|
|
166
165
|
- definitions/checks/container/podman_login.rb
|
|
167
166
|
- definitions/checks/disk/available_space.rb
|
|
@@ -241,7 +240,6 @@ files:
|
|
|
241
240
|
- definitions/features/pulpcore_database.rb
|
|
242
241
|
- definitions/features/puppet_server.rb
|
|
243
242
|
- definitions/features/redis.rb
|
|
244
|
-
- definitions/features/rh_cloud.rb
|
|
245
243
|
- definitions/features/salt_server.rb
|
|
246
244
|
- definitions/features/satellite.rb
|
|
247
245
|
- definitions/features/service.rb
|
|
@@ -357,7 +355,6 @@ files:
|
|
|
357
355
|
- definitions/reports/provisioning.rb
|
|
358
356
|
- definitions/reports/rbac.rb
|
|
359
357
|
- definitions/reports/recurring_logics.rb
|
|
360
|
-
- definitions/reports/rh_cloud.rb
|
|
361
358
|
- definitions/reports/selinux.rb
|
|
362
359
|
- definitions/reports/template
|
|
363
360
|
- definitions/reports/virt_who.rb
|
|
@@ -490,7 +487,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
490
487
|
- !ruby/object:Gem::Version
|
|
491
488
|
version: '0'
|
|
492
489
|
requirements: []
|
|
493
|
-
rubygems_version:
|
|
490
|
+
rubygems_version: 3.6.9
|
|
494
491
|
specification_version: 4
|
|
495
492
|
summary: Foreman maintenance tool belt
|
|
496
493
|
test_files: []
|
|
@@ -1,41 +0,0 @@
|
|
|
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
|
|
@@ -1,19 +0,0 @@
|
|
|
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
|
|
@@ -1,104 +0,0 @@
|
|
|
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
|