foreman_maintain 1.13.2 → 1.13.3
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/procedures/pulpcore/rpm_datarepair.rb +17 -0
- data/definitions/scenarios/foreman_upgrade.rb +1 -2
- data/definitions/scenarios/satellite_upgrade.rb +1 -2
- data/lib/foreman_maintain/concerns/downstream.rb +15 -1
- data/lib/foreman_maintain/version.rb +1 -1
- metadata +2 -3
- data/definitions/checks/disk/available_space_postgresql13.rb +0 -42
- data/definitions/checks/sca_only.rb +0 -56
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4082c169b1eb743083f6ecb900baede1873b61864734ed3257a3a7f0c95836fc
|
4
|
+
data.tar.gz: f6232f0d970880abbd3ede420d46afef364c1026b75a4503d06e25265a3b2c5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c395bf50959d58e4a31d79a9238986f78dad6d24ad433c11a66f0630921b3646a292334331ae27a8765bc048371dd82bc33bb6ca94c8ea27aad2190a28476cd
|
7
|
+
data.tar.gz: 77c15f1caec28991de6b3123c201ae5c5235f26a397657f6e133dc35f84e3a2c2b9cad6557b4bbc8b458079feb56b857ba4daa49bf9db5c0b4dcece2bd58dc7a
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Procedures::Pulpcore
|
2
|
+
class RpmDatarepair < ForemanMaintain::Procedure
|
3
|
+
include ForemanMaintain::Concerns::PulpCommon
|
4
|
+
|
5
|
+
metadata do
|
6
|
+
description 'Rename ContentArtifact relative_paths to match `{N-V-R.A.rpm}`'
|
7
|
+
for_feature :pulpcore
|
8
|
+
end
|
9
|
+
|
10
|
+
def run
|
11
|
+
with_spinner('Running pulpcore-manager rpm-datarepair 4073') do
|
12
|
+
# Assumption: services are already started
|
13
|
+
execute!(pulpcore_manager('rpm-datarepair 4073'))
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -38,7 +38,6 @@ module Scenarios::Foreman
|
|
38
38
|
Checks::CheckUpstreamRepository,
|
39
39
|
Checks::Disk::AvailableSpace,
|
40
40
|
Checks::Disk::AvailableSpaceCandlepin, # if candlepin
|
41
|
-
Checks::Disk::AvailableSpacePostgresql13,
|
42
41
|
Checks::Disk::PostgresqlMountpoint,
|
43
42
|
Checks::Foreman::ValidateExternalDbVersion, # if external database
|
44
43
|
Checks::Foreman::CheckExternalDbEvrPermissions, # if external database
|
@@ -54,7 +53,6 @@ module Scenarios::Foreman
|
|
54
53
|
Checks::NonRhPackages,
|
55
54
|
Checks::PackageManager::Dnf::ValidateDnfConfig,
|
56
55
|
Checks::Repositories::CheckNonRhRepository,
|
57
|
-
Checks::CheckOrganizationContentAccessMode,
|
58
56
|
Checks::CheckSha1CertificateAuthority,
|
59
57
|
Checks::Repositories::Validate
|
60
58
|
)
|
@@ -113,6 +111,7 @@ module Scenarios::Foreman
|
|
113
111
|
add_steps(
|
114
112
|
Procedures::RefreshFeatures,
|
115
113
|
Procedures::Service::Start,
|
114
|
+
Procedures::Pulpcore::RpmDatarepair,
|
116
115
|
Procedures::Crond::Start,
|
117
116
|
Procedures::Timer::Start,
|
118
117
|
Procedures::SyncPlans::Enable,
|
@@ -55,8 +55,6 @@ module Scenarios::Satellite
|
|
55
55
|
Checks::PackageManager::Dnf::ValidateDnfConfig,
|
56
56
|
Checks::Repositories::CheckNonRhRepository,
|
57
57
|
Checks::CheckIpv6Disable,
|
58
|
-
Checks::Disk::AvailableSpacePostgresql13,
|
59
|
-
Checks::CheckOrganizationContentAccessMode,
|
60
58
|
Checks::CheckSha1CertificateAuthority,
|
61
59
|
Checks::Repositories::Validate.new(:version => target_version),
|
62
60
|
)
|
@@ -117,6 +115,7 @@ module Scenarios::Satellite
|
|
117
115
|
add_steps(
|
118
116
|
Procedures::RefreshFeatures,
|
119
117
|
Procedures::Service::Start,
|
118
|
+
Procedures::Pulpcore::RpmDatarepair,
|
120
119
|
Procedures::Crond::Start,
|
121
120
|
Procedures::Timer::Start,
|
122
121
|
Procedures::SyncPlans::Enable,
|
@@ -21,8 +21,16 @@ module ForemanMaintain
|
|
21
21
|
execute!(%(subscription-manager register #{org_options}\
|
22
22
|
--activationkey #{shellescape(activation_key)} --force))
|
23
23
|
else
|
24
|
+
had_utils_enabled = repository_manager.enabled_repos.keys.any? do |r|
|
25
|
+
r.start_with?("satellite-utils-")
|
26
|
+
end
|
27
|
+
|
24
28
|
repository_manager.rhsm_disable_repos(['*'])
|
25
|
-
|
29
|
+
|
30
|
+
repos = rh_repos(version)
|
31
|
+
repos << utils_repo(version) if had_utils_enabled
|
32
|
+
|
33
|
+
repository_manager.rhsm_enable_repos(repos)
|
26
34
|
end
|
27
35
|
end
|
28
36
|
|
@@ -64,6 +72,12 @@ module ForemanMaintain
|
|
64
72
|
|
65
73
|
private
|
66
74
|
|
75
|
+
def utils_repo(server_version)
|
76
|
+
server_version = version(server_version)
|
77
|
+
full_version = "#{server_version.major}.#{server_version.minor}"
|
78
|
+
"satellite-utils-#{full_version}-for-rhel-#{el_major_version}-x86_64-rpms"
|
79
|
+
end
|
80
|
+
|
67
81
|
def satellite_maintain_config
|
68
82
|
if File.exist?(SATELLITE_MAINTAIN_CONFIG)
|
69
83
|
YAML.load_file(SATELLITE_MAINTAIN_CONFIG)
|
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.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Nečas
|
@@ -165,7 +165,6 @@ files:
|
|
165
165
|
- definitions/checks/container/podman_login.rb
|
166
166
|
- definitions/checks/disk/available_space.rb
|
167
167
|
- definitions/checks/disk/available_space_candlepin.rb
|
168
|
-
- definitions/checks/disk/available_space_postgresql13.rb
|
169
168
|
- definitions/checks/disk/performance.rb
|
170
169
|
- definitions/checks/disk/postgresql_mountpoint.rb
|
171
170
|
- definitions/checks/env_proxy.rb
|
@@ -206,7 +205,6 @@ files:
|
|
206
205
|
- definitions/checks/restore/validate_interfaces.rb
|
207
206
|
- definitions/checks/restore/validate_postgresql_dump_permissions.rb
|
208
207
|
- definitions/checks/root_user.rb
|
209
|
-
- definitions/checks/sca_only.rb
|
210
208
|
- definitions/checks/server_ping.rb
|
211
209
|
- definitions/checks/services_up.rb
|
212
210
|
- definitions/checks/system_registration.rb
|
@@ -297,6 +295,7 @@ files:
|
|
297
295
|
- definitions/procedures/packages/update.rb
|
298
296
|
- definitions/procedures/packages/update_all_confirmation.rb
|
299
297
|
- definitions/procedures/pulpcore/container_handle_image_metadata.rb
|
298
|
+
- definitions/procedures/pulpcore/rpm_datarepair.rb
|
300
299
|
- definitions/procedures/pulpcore/wait_for_tasks.rb
|
301
300
|
- definitions/procedures/puppet/delete_empty_ca_cert_request_files.rb
|
302
301
|
- definitions/procedures/puppet/remove_puppet.rb
|
@@ -1,42 +0,0 @@
|
|
1
|
-
module Checks
|
2
|
-
module Disk
|
3
|
-
class AvailableSpacePostgresql13 < ForemanMaintain::Check
|
4
|
-
metadata do
|
5
|
-
label :available_space_for_postgresql13
|
6
|
-
description 'Check to make sure PostgreSQL 13 work directory has enough space for upgrade'
|
7
|
-
confine do
|
8
|
-
feature(:instance).postgresql_local?
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
def run
|
13
|
-
assert(psql_13_available_space >= psql_12_consumed_space, warning_message)
|
14
|
-
end
|
15
|
-
|
16
|
-
def pgsql_dir(version)
|
17
|
-
case version
|
18
|
-
when 12
|
19
|
-
'/var/lib/pgsql/data'
|
20
|
-
when 13
|
21
|
-
'/var/lib/pgsql'
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
def psql_12_consumed_space
|
26
|
-
io_obj = ForemanMaintain::Utils::Disk::IODevice.new(pgsql_dir(12))
|
27
|
-
io_obj.space_used
|
28
|
-
end
|
29
|
-
|
30
|
-
def psql_13_available_space
|
31
|
-
io_obj = ForemanMaintain::Utils::Disk::IODevice.new(pgsql_dir(13))
|
32
|
-
io_obj.available_space
|
33
|
-
end
|
34
|
-
|
35
|
-
def warning_message
|
36
|
-
"PostgreSQL will be upgraded from 12 to 13. \n" \
|
37
|
-
"During the upgrade a backup is created in /var/lib/pgsql/data-old and requires " \
|
38
|
-
"at least #{psql_12_consumed_space} MiB free space."
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
@@ -1,56 +0,0 @@
|
|
1
|
-
class Checks::CheckOrganizationContentAccessMode < ForemanMaintain::Check
|
2
|
-
metadata do
|
3
|
-
label :check_organization_content_access_mode
|
4
|
-
description 'Check if any organizations are using entitlement mode'
|
5
|
-
|
6
|
-
confine do
|
7
|
-
feature(:katello)
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
def run
|
12
|
-
doc_link = "https://access.redhat.com/articles/simple-content-access"
|
13
|
-
|
14
|
-
with_spinner('Checking organization content access modes') do
|
15
|
-
output = execute_org_check
|
16
|
-
orgs_to_migrate = parse_orgs_to_migrate(output)
|
17
|
-
|
18
|
-
assert(
|
19
|
-
orgs_to_migrate.empty?,
|
20
|
-
"\nThe following organizations are using entitlement mode:\n"\
|
21
|
-
"#{format_orgs_to_migrate(orgs_to_migrate)}\n\n"\
|
22
|
-
"As of Satellite 6.16, entitlement mode is removed, and these organizations"\
|
23
|
-
" will be automatically migrated to Simple Content Access during the upgrade."\
|
24
|
-
" Please ensure that you have reviewed the documentation and are prepared for this change."\
|
25
|
-
" Documentation for SCA mode is available at #{doc_link}"
|
26
|
-
)
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
private
|
31
|
-
|
32
|
-
# rubocop:disable Lint/InterpolationCheck
|
33
|
-
def execute_org_check
|
34
|
-
execute!(
|
35
|
-
'echo "Organization.all.each ' \
|
36
|
-
'{ |org| puts \"NONSCA: #{org.name}\" unless org.simple_content_access? }" ' \
|
37
|
-
'| foreman-rake console'
|
38
|
-
)
|
39
|
-
end
|
40
|
-
# rubocop:enable Lint/InterpolationCheck
|
41
|
-
|
42
|
-
def parse_orgs_to_migrate(output)
|
43
|
-
orgs = []
|
44
|
-
output.each_line do |line|
|
45
|
-
match = line.match(/NONSCA: (.+)/)
|
46
|
-
if match && !match[1].strip.start_with?('#{org.name}') # rubocop:disable Lint/InterpolationCheck
|
47
|
-
orgs << match[1].strip
|
48
|
-
end
|
49
|
-
end
|
50
|
-
orgs
|
51
|
-
end
|
52
|
-
|
53
|
-
def format_orgs_to_migrate(orgs_to_migrate)
|
54
|
-
orgs_to_migrate.join("\n")
|
55
|
-
end
|
56
|
-
end
|