foreman_maintain 1.6.7 → 1.6.9
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 +3 -5
- data/definitions/checks/check_ipv6_disable.rb +23 -0
- data/definitions/features/capsule.rb +1 -2
- data/definitions/features/dynflow_sidekiq.rb +1 -6
- data/definitions/features/foreman_install.rb +12 -0
- data/definitions/features/foreman_server.rb +0 -1
- data/definitions/features/foreman_tasks.rb +0 -8
- data/definitions/features/instance.rb +18 -1
- data/definitions/features/katello.rb +0 -15
- data/definitions/features/satellite.rb +4 -0
- data/definitions/procedures/hammer_setup.rb +3 -0
- data/definitions/procedures/installer/upgrade_rake_task.rb +4 -3
- data/definitions/procedures/packages/update.rb +2 -0
- data/definitions/procedures/pulpcore/container_handle_image_metadata.rb +26 -0
- data/definitions/procedures/restore/configs.rb +0 -19
- data/definitions/procedures/restore/drop_databases.rb +1 -3
- data/definitions/procedures/restore/reindex_databases.rb +6 -0
- data/definitions/procedures/restore/required_packages.rb +0 -1
- data/definitions/scenarios/backup.rb +9 -20
- data/definitions/scenarios/foreman_upgrade.rb +2 -1
- data/definitions/scenarios/restore.rb +11 -29
- data/definitions/scenarios/{upgrade_to_satellite_6_16.rb → satellite_upgrade.rb} +11 -10
- data/definitions/scenarios/self_upgrade.rb +19 -13
- data/definitions/scenarios/update.rb +1 -0
- data/lib/foreman_maintain/cli/upgrade_command.rb +1 -22
- data/lib/foreman_maintain/concerns/base_database.rb +0 -6
- data/lib/foreman_maintain/concerns/system_helpers.rb +3 -2
- data/lib/foreman_maintain/package_manager/apt.rb +3 -1
- data/lib/foreman_maintain/package_manager/dnf.rb +10 -5
- data/lib/foreman_maintain/utils/backup.rb +10 -23
- data/lib/foreman_maintain/version.rb +1 -1
- metadata +5 -10
- data/definitions/features/gofer.rb +0 -16
- data/definitions/procedures/pulpcore/migrate.rb +0 -24
- data/definitions/procedures/restore/candlepin_reset_migrations.rb +0 -14
- data/definitions/procedures/selinux/set_file_security.rb +0 -25
- data/definitions/scenarios/upgrade_to_capsule_6_16.rb +0 -100
- data/definitions/scenarios/upgrade_to_capsule_6_16_z.rb +0 -97
- data/definitions/scenarios/upgrade_to_satellite_6_16_z.rb +0 -98
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cdd4ef357f342501b15fbaf461be19952c2d09fde6fb7c1f3523711201ef3faa
|
4
|
+
data.tar.gz: cc9b2d323a171c5676276767f11c4a83adc5123fab01f58114d88a80a3ddba13
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fffefa90d5f28514280c732cb232003acb543420a9ca9fd5a9cf77749beecb1533a05d71bb6b7c5db1e3e06dcb5909a5fa3e8f85ef3a98ae369f090cef84c052
|
7
|
+
data.tar.gz: cb4997dcbb7eba53f9e4d82445ad327316e3a1ace686e62ffd0b3f4a63ecd418542d73c42d7fe10692fb48054dc902b42faaff2772c744e91c421160210fec13
|
data/README.md
CHANGED
@@ -17,7 +17,6 @@ Subcommands:
|
|
17
17
|
--tags tags Run only those with all specific set of tags
|
18
18
|
|
19
19
|
upgrade Upgrade related commands
|
20
|
-
list-versions List versions this system is upgradable to
|
21
20
|
check --target-version TARGET_VERSION Run pre-upgrade checks for upgrading to specified version
|
22
21
|
--disable-self-upgrade Disable automatic self upgrade (default: false)
|
23
22
|
run --target-version TARGET_VERSION Run the full upgrade
|
@@ -56,12 +55,11 @@ Subcommands:
|
|
56
55
|
Foreman-maintain implements upgrade tooling that helps the administrator to go
|
57
56
|
through the upgrade process.
|
58
57
|
|
59
|
-
|
60
|
-
|
61
|
-
for upgrade, run:
|
58
|
+
The foreman-maintain tool is intended to self upgrade itself to the next major
|
59
|
+
version of the project. This is needed before upgrading, run:
|
62
60
|
|
63
61
|
```
|
64
|
-
foreman-maintain upgrade
|
62
|
+
foreman-maintain self-upgrade
|
65
63
|
```
|
66
64
|
|
67
65
|
To perform just the pre-upgrade checks for the system, run:
|
@@ -0,0 +1,23 @@
|
|
1
|
+
class Checks::CheckIpv6Disable < ForemanMaintain::Check
|
2
|
+
metadata do
|
3
|
+
label :check_ipv6_disable
|
4
|
+
description 'Check if ipv6.disable=1 is set at kernel level'
|
5
|
+
end
|
6
|
+
|
7
|
+
def run
|
8
|
+
cmdline_file = File.read('/proc/cmdline')
|
9
|
+
|
10
|
+
assert(!cmdline_file.include?("ipv6.disable=1"), error_message)
|
11
|
+
end
|
12
|
+
|
13
|
+
def error_message
|
14
|
+
base = "\nThe kernel contains ipv6.disable=1 which is known to break installation and upgrade"\
|
15
|
+
", remove and reboot before continuining."
|
16
|
+
|
17
|
+
if feature(:instance).downstream
|
18
|
+
base += " See https://access.redhat.com/solutions/5045841 for more details."
|
19
|
+
end
|
20
|
+
|
21
|
+
base
|
22
|
+
end
|
23
|
+
end
|
@@ -7,8 +7,7 @@ class Features::Capsule < ForemanMaintain::Feature
|
|
7
7
|
|
8
8
|
confine do
|
9
9
|
!package_manager.installed?(['satellite']) &&
|
10
|
-
package_manager.installed?(['satellite-capsule'])
|
11
|
-
package_manager.installed?(['capsule-installer'])
|
10
|
+
package_manager.installed?(['satellite-capsule'])
|
12
11
|
end
|
13
12
|
end
|
14
13
|
|
@@ -8,14 +8,9 @@ class Features::DynflowSidekiq < ForemanMaintain::Feature
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def config_files
|
11
|
-
# Workaround until foreman-installer can deploy scaled workers
|
12
|
-
service_symlinks = configured_instances.map do |service|
|
13
|
-
"/etc/systemd/system/multi-user.target.wants/#{service}.service"
|
14
|
-
end
|
15
11
|
[
|
16
12
|
'/etc/foreman/dynflow',
|
17
|
-
|
18
|
-
].flatten
|
13
|
+
]
|
19
14
|
end
|
20
15
|
|
21
16
|
def services
|
@@ -9,4 +9,16 @@ class Features::ForemanInstall < ForemanMaintain::Feature
|
|
9
9
|
!feature(:instance).downstream && feature(:foreman_server)
|
10
10
|
end
|
11
11
|
end
|
12
|
+
|
13
|
+
def target_version
|
14
|
+
'3.11'
|
15
|
+
end
|
16
|
+
|
17
|
+
def current_version
|
18
|
+
@current_version ||= package_version(package_name)
|
19
|
+
end
|
20
|
+
|
21
|
+
def package_name
|
22
|
+
'foreman'
|
23
|
+
end
|
12
24
|
end
|
@@ -125,14 +125,6 @@ class Features::ForemanTasks < ForemanMaintain::Feature
|
|
125
125
|
puts "\nTimeout: #{e.message}. Try again."
|
126
126
|
end
|
127
127
|
|
128
|
-
def services
|
129
|
-
feature(:dynflow_sidekiq) ? [] : [system_service(service_name, 30)]
|
130
|
-
end
|
131
|
-
|
132
|
-
def service_name
|
133
|
-
'dynflowd'
|
134
|
-
end
|
135
|
-
|
136
128
|
private
|
137
129
|
|
138
130
|
def check_task_count(state, spinner)
|
@@ -91,6 +91,24 @@ class Features::Instance < ForemanMaintain::Feature
|
|
91
91
|
feature(:foreman_install) || feature(:katello_install)
|
92
92
|
end
|
93
93
|
|
94
|
+
def current_version
|
95
|
+
version = if feature(:instance).downstream
|
96
|
+
feature(:instance).downstream.current_version
|
97
|
+
else
|
98
|
+
feature(:foreman_install).current_version
|
99
|
+
end
|
100
|
+
|
101
|
+
version.to_s[/^\d+\.\d+\.\d+/]
|
102
|
+
end
|
103
|
+
|
104
|
+
def target_version
|
105
|
+
if feature(:instance).downstream
|
106
|
+
Features::Satellite.new.target_version
|
107
|
+
else
|
108
|
+
Features::ForemanInstall.new.target_version
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
94
112
|
private
|
95
113
|
|
96
114
|
# rubocop:disable Metrics/AbcSize
|
@@ -162,7 +180,6 @@ class Features::Instance < ForemanMaintain::Feature
|
|
162
180
|
'pulp3' => %w[pulpcore pulpcore_database],
|
163
181
|
'pulp3_content' => %w[pulpcore pulpcore_database],
|
164
182
|
'foreman_tasks' => %w[foreman_tasks],
|
165
|
-
'katello_agent' => %w[katello],
|
166
183
|
'katello_events' => %w[katello],
|
167
184
|
}
|
168
185
|
end
|
@@ -17,14 +17,6 @@ class Features::Katello < ForemanMaintain::Feature
|
|
17
17
|
@current_version ||= package_version('katello')
|
18
18
|
end
|
19
19
|
|
20
|
-
def services
|
21
|
-
[
|
22
|
-
system_service('qpidd', 10),
|
23
|
-
system_service('qdrouterd', 10),
|
24
|
-
]
|
25
|
-
end
|
26
|
-
|
27
|
-
# rubocop:disable Metrics/MethodLength
|
28
20
|
def config_files
|
29
21
|
configs = [
|
30
22
|
'/etc/pki/katello',
|
@@ -35,11 +27,6 @@ class Features::Katello < ForemanMaintain::Feature
|
|
35
27
|
'/etc/sysconfig/tomcat*',
|
36
28
|
'/etc/tomcat*',
|
37
29
|
'/var/lib/candlepin',
|
38
|
-
'/usr/share/foreman/bundler.d/katello.rb',
|
39
|
-
'/etc/qpid',
|
40
|
-
'/etc/qpid-dispatch',
|
41
|
-
'/var/lib/qpidd',
|
42
|
-
'/etc/qpid-dispatch',
|
43
30
|
]
|
44
31
|
|
45
32
|
if installer_scenario_answers['certs']
|
@@ -53,11 +40,9 @@ class Features::Katello < ForemanMaintain::Feature
|
|
53
40
|
|
54
41
|
configs
|
55
42
|
end
|
56
|
-
# rubocop:enable Metrics/MethodLength
|
57
43
|
|
58
44
|
def config_files_exclude_for_online
|
59
45
|
[
|
60
|
-
'/var/lib/qpidd',
|
61
46
|
'/var/lib/candlepin/activemq-artemis',
|
62
47
|
]
|
63
48
|
end
|
@@ -2,12 +2,13 @@ module Procedures::Installer
|
|
2
2
|
class UpgradeRakeTask < ForemanMaintain::Procedure
|
3
3
|
metadata do
|
4
4
|
description 'Execute upgrade:run rake task'
|
5
|
+
confine do
|
6
|
+
feature(:satellite)
|
7
|
+
end
|
5
8
|
end
|
6
9
|
|
7
10
|
def run
|
8
|
-
|
9
|
-
# the installer runs this rake task for us already
|
10
|
-
execute!('foreman-rake upgrade:run') if feature(:satellite)
|
11
|
+
execute!('foreman-rake upgrade:run')
|
11
12
|
end
|
12
13
|
end
|
13
14
|
end
|
@@ -8,6 +8,7 @@ module Procedures::Packages
|
|
8
8
|
:flag => true, :default => false
|
9
9
|
param :download_only, 'Download and cache packages only', :flag => true, :default => false
|
10
10
|
param :clean_cache, 'If true will cause a DNF cache clean', :flag => true, :default => true
|
11
|
+
param :enabled_repos, 'List of repositories to enable', :array => true
|
11
12
|
end
|
12
13
|
|
13
14
|
def run
|
@@ -16,6 +17,7 @@ module Procedures::Packages
|
|
16
17
|
opts = {
|
17
18
|
:assumeyes => assumeyes_val,
|
18
19
|
:download_only => @download_only,
|
20
|
+
:enabled_repos => @enabled_repos,
|
19
21
|
}
|
20
22
|
packages_action(:update, @packages, opts)
|
21
23
|
rescue ForemanMaintain::Error::ExecutionError => e
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module Procedures::Pulpcore
|
2
|
+
class ContainerHandleImageMetadata < ForemanMaintain::Procedure
|
3
|
+
include ForemanMaintain::Concerns::SystemService
|
4
|
+
include ForemanMaintain::Concerns::PulpCommon
|
5
|
+
|
6
|
+
metadata do
|
7
|
+
description 'Initialize and expose container image metadata in the pulpcore db'
|
8
|
+
for_feature :pulpcore
|
9
|
+
end
|
10
|
+
|
11
|
+
def run
|
12
|
+
with_spinner('Initialize and expose container image metadata in the pulpcore db') do |spinner|
|
13
|
+
necessary_services = feature(:pulpcore_database).services
|
14
|
+
|
15
|
+
feature(:service).handle_services(spinner, 'start', :only => necessary_services)
|
16
|
+
|
17
|
+
spinner.update('Adding image metadata to pulp. You can continue using the ' \
|
18
|
+
'system normally while the task runs in the background.')
|
19
|
+
execute!(pulpcore_manager('container-handle-image-data'))
|
20
|
+
spinner.update('Adding image metadata to katello. You can continue using the ' \
|
21
|
+
'system normally while the task runs in the background.')
|
22
|
+
execute!('foreman-rake katello:import_container_manifest_labels')
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -14,18 +14,10 @@ module Procedures::Restore
|
|
14
14
|
spinner.update('Restoring configs')
|
15
15
|
clean_conflicting_data
|
16
16
|
restore_configs(backup)
|
17
|
-
reset_qpid_jrnls
|
18
17
|
end
|
19
18
|
end
|
20
19
|
|
21
20
|
def restore_configs(backup)
|
22
|
-
exclude = ForemanMaintain.available_features.each_with_object([]) do |feat, cfgs|
|
23
|
-
if backup.online_backup?
|
24
|
-
feat.config_files_exclude_for_online.each { |f| cfgs << f.gsub(%r{^/}, '') }
|
25
|
-
end
|
26
|
-
feat.config_files_to_exclude.each { |f| cfgs << f.gsub(%r{^/}, '') }
|
27
|
-
end
|
28
|
-
|
29
21
|
tar_options = {
|
30
22
|
:overwrite => true,
|
31
23
|
:listed_incremental => '/dev/null',
|
@@ -33,7 +25,6 @@ module Procedures::Restore
|
|
33
25
|
:directory => '/',
|
34
26
|
:archive => backup.file_map[:config_files][:path],
|
35
27
|
:gzip => true,
|
36
|
-
:exclude => exclude,
|
37
28
|
}
|
38
29
|
|
39
30
|
feature(:tar).run(tar_options)
|
@@ -45,15 +36,5 @@ module Procedures::Restore
|
|
45
36
|
# tar is unable to --overwrite dir with symlink
|
46
37
|
execute('rm -rf /usr/share/foreman-proxy/.ssh')
|
47
38
|
end
|
48
|
-
|
49
|
-
def reset_qpid_jrnls
|
50
|
-
# on restore without pulp data qpid fails to start
|
51
|
-
# https://access.redhat.com/solutions/4645231
|
52
|
-
['/var/lib/qpidd/.qpidd/', '/var/lib/qpidd/'].each do |qpidd_path|
|
53
|
-
if Dir.exist?("#{qpidd_path}/qls/dat2/")
|
54
|
-
execute("rm -rf #{qpidd_path}/qls/dat2/__db.00*")
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
39
|
end
|
59
40
|
end
|
@@ -19,9 +19,7 @@ module Procedures::Restore
|
|
19
19
|
feature(:service).handle_services(spinner, 'start', :only => ['postgresql'])
|
20
20
|
drop_foreman(backup, spinner)
|
21
21
|
drop_candlepin(backup, spinner)
|
22
|
-
|
23
|
-
drop_pulpcore(backup, spinner)
|
24
|
-
end
|
22
|
+
drop_pulpcore(backup, spinner)
|
25
23
|
end
|
26
24
|
end
|
27
25
|
|
@@ -1,6 +1,7 @@
|
|
1
1
|
module Procedures::Restore
|
2
2
|
class ReindexDatabases < ForemanMaintain::Procedure
|
3
3
|
include ForemanMaintain::Concerns::SystemService
|
4
|
+
include ForemanMaintain::Concerns::SystemHelpers
|
4
5
|
|
5
6
|
metadata do
|
6
7
|
description 'REINDEX databases'
|
@@ -16,6 +17,11 @@ module Procedures::Restore
|
|
16
17
|
|
17
18
|
spinner.update('Reindexing the databases')
|
18
19
|
execute!('runuser - postgres -c "reindexdb -a"')
|
20
|
+
if check_min_version('python3.11-pulp-ansible', '0.20.0')
|
21
|
+
execute!('runuser -c '\
|
22
|
+
'\'echo "ALTER COLLATION pulp_ansible_semver REFRESH VERSION;"'\
|
23
|
+
'| psql pulpcore\' postgres')
|
24
|
+
end
|
19
25
|
end
|
20
26
|
end
|
21
27
|
end
|
@@ -12,7 +12,6 @@ module Procedures::Restore
|
|
12
12
|
backup = ForemanMaintain::Utils::Backup.new(@backup_dir)
|
13
13
|
required_packages = []
|
14
14
|
required_packages << 'puppetserver' if backup.with_puppetserver?
|
15
|
-
required_packages << 'qpid-cpp-server' if backup.with_qpidd?
|
16
15
|
if required_packages.any?
|
17
16
|
with_spinner('Installing required packages') do
|
18
17
|
ForemanMaintain.package_manager.install(required_packages, assumeyes: true)
|
@@ -19,9 +19,9 @@ module ForemanMaintain::Scenarios
|
|
19
19
|
def compose
|
20
20
|
check_valid_strategy
|
21
21
|
safety_confirmation
|
22
|
-
|
23
|
-
|
24
|
-
add_step_with_context(Procedures::Backup::Metadata, :online_backup =>
|
22
|
+
add_step_with_context(Procedures::Backup::AccessibilityConfirmation) if strategy == :offline
|
23
|
+
add_step_with_context(Procedures::Backup::PrepareDirectory)
|
24
|
+
add_step_with_context(Procedures::Backup::Metadata, :online_backup => strategy == :online)
|
25
25
|
|
26
26
|
case strategy
|
27
27
|
when :online
|
@@ -29,6 +29,7 @@ module ForemanMaintain::Scenarios
|
|
29
29
|
when :offline
|
30
30
|
add_offline_backup_steps
|
31
31
|
end
|
32
|
+
|
32
33
|
add_step_with_context(Procedures::Backup::CompressData)
|
33
34
|
end
|
34
35
|
|
@@ -64,18 +65,8 @@ module ForemanMaintain::Scenarios
|
|
64
65
|
|
65
66
|
private
|
66
67
|
|
67
|
-
def prepare_directory
|
68
|
-
add_step_with_context(Procedures::Backup::PrepareDirectory)
|
69
|
-
end
|
70
|
-
|
71
|
-
def accessibility_confirmation
|
72
|
-
if strategy == :offline
|
73
|
-
add_step_with_context(Procedures::Backup::AccessibilityConfirmation)
|
74
|
-
end
|
75
|
-
end
|
76
|
-
|
77
68
|
def safety_confirmation
|
78
|
-
if
|
69
|
+
if strategy == :online || include_db_dumps?
|
79
70
|
add_step_with_context(Procedures::Backup::Online::SafetyConfirmation)
|
80
71
|
end
|
81
72
|
end
|
@@ -132,10 +123,6 @@ module ForemanMaintain::Scenarios
|
|
132
123
|
def include_db_dumps?
|
133
124
|
!!context.get(:include_db_dumps)
|
134
125
|
end
|
135
|
-
|
136
|
-
def online_backup?
|
137
|
-
strategy == :online
|
138
|
-
end
|
139
126
|
end
|
140
127
|
|
141
128
|
class BackupRescueCleanup < ForemanMaintain::Scenario
|
@@ -149,8 +136,10 @@ module ForemanMaintain::Scenarios
|
|
149
136
|
end
|
150
137
|
|
151
138
|
def compose
|
152
|
-
|
153
|
-
|
139
|
+
if strategy == :offline
|
140
|
+
add_step_with_context(Procedures::Service::Start)
|
141
|
+
add_steps_with_context(find_procedures(:maintenance_mode_off))
|
142
|
+
end
|
154
143
|
add_step_with_context(Procedures::Backup::Clean)
|
155
144
|
end
|
156
145
|
|
@@ -134,7 +134,8 @@ module Scenarios::ForemanUpgrade
|
|
134
134
|
Checks::ServerPing,
|
135
135
|
Checks::ServicesUp,
|
136
136
|
Checks::SystemRegistration,
|
137
|
-
Procedures::Packages::CheckForReboot
|
137
|
+
Procedures::Packages::CheckForReboot,
|
138
|
+
Procedures::Pulpcore::ContainerHandleImageMetadata
|
138
139
|
)
|
139
140
|
end
|
140
141
|
end
|
@@ -11,7 +11,6 @@ module ForemanMaintain::Scenarios
|
|
11
11
|
end
|
12
12
|
|
13
13
|
# rubocop:disable Metrics/MethodLength,Metrics/AbcSize
|
14
|
-
# rubocop:disable Metrics/CyclomaticComplexity
|
15
14
|
def compose
|
16
15
|
backup = ForemanMaintain::Utils::Backup.new(context.get(:backup_dir))
|
17
16
|
|
@@ -27,7 +26,6 @@ module ForemanMaintain::Scenarios
|
|
27
26
|
end
|
28
27
|
|
29
28
|
add_steps_with_context(Procedures::Restore::Confirmation,
|
30
|
-
Procedures::Selinux::SetFileSecurity,
|
31
29
|
Procedures::Restore::RequiredPackages,
|
32
30
|
Procedures::Restore::Configs)
|
33
31
|
add_step_with_context(Procedures::Crond::Stop) if feature(:cron)
|
@@ -36,13 +34,10 @@ module ForemanMaintain::Scenarios
|
|
36
34
|
end
|
37
35
|
add_step_with_context(Procedures::Service::Stop)
|
38
36
|
add_steps_with_context(Procedures::Restore::ExtractFiles) if backup.tar_backups_exist?
|
39
|
-
|
40
|
-
if backup.
|
41
|
-
|
42
|
-
|
43
|
-
restore_sql_dumps(backup)
|
44
|
-
if backup.sql_dump_files_exist? && feature(:instance).postgresql_local?
|
45
|
-
add_step(Procedures::Service::Stop.new(:only => ['postgresql']))
|
37
|
+
|
38
|
+
if backup.sql_needs_dump_restore?
|
39
|
+
add_steps_with_context(Procedures::Restore::DropDatabases)
|
40
|
+
restore_sql_dumps(backup)
|
46
41
|
end
|
47
42
|
|
48
43
|
if feature(:instance).postgresql_local? &&
|
@@ -51,38 +46,28 @@ module ForemanMaintain::Scenarios
|
|
51
46
|
add_step_with_context(Procedures::Restore::ReindexDatabases)
|
52
47
|
end
|
53
48
|
|
54
|
-
add_steps_with_context(
|
55
|
-
Procedures::Pulpcore::Migrate,
|
56
|
-
Procedures::Restore::CandlepinResetMigrations
|
57
|
-
)
|
58
|
-
|
59
|
-
add_steps_with_context(Procedures::Service::Start,
|
60
|
-
Procedures::Service::DaemonReload)
|
61
49
|
add_step(Procedures::Installer::Run.new(:assumeyes => true))
|
62
50
|
add_step_with_context(Procedures::Installer::UpgradeRakeTask)
|
63
51
|
add_step_with_context(Procedures::Crond::Start) if feature(:cron)
|
64
52
|
end
|
65
53
|
# rubocop:enable Metrics/MethodLength,Metrics/AbcSize
|
66
|
-
# rubocop:enable Metrics/CyclomaticComplexity
|
67
|
-
|
68
|
-
def drop_dbs(backup)
|
69
|
-
if backup.file_map[:candlepin_dump][:present] ||
|
70
|
-
backup.file_map[:foreman_dump][:present] ||
|
71
|
-
(feature(:pulpcore) && backup.file_map[:pulpcore_dump][:present])
|
72
|
-
add_steps_with_context(Procedures::Restore::DropDatabases)
|
73
|
-
end
|
74
|
-
end
|
75
54
|
|
76
55
|
def restore_sql_dumps(backup)
|
56
|
+
if feature(:instance).postgresql_local?
|
57
|
+
add_step(Procedures::Service::Start.new(:only => ['postgresql']))
|
58
|
+
end
|
77
59
|
if backup.file_map[:candlepin_dump][:present]
|
78
60
|
add_steps_with_context(Procedures::Restore::CandlepinDump)
|
79
61
|
end
|
80
62
|
if backup.file_map[:foreman_dump][:present]
|
81
63
|
add_steps_with_context(Procedures::Restore::ForemanDump)
|
82
64
|
end
|
83
|
-
if
|
65
|
+
if backup.file_map[:pulpcore_dump][:present]
|
84
66
|
add_steps_with_context(Procedures::Restore::PulpcoreDump)
|
85
67
|
end
|
68
|
+
if feature(:instance).postgresql_local?
|
69
|
+
add_step(Procedures::Service::Stop.new(:only => ['postgresql']))
|
70
|
+
end
|
86
71
|
end
|
87
72
|
|
88
73
|
def set_context_mapping
|
@@ -98,9 +83,6 @@ module ForemanMaintain::Scenarios
|
|
98
83
|
Procedures::Restore::ForemanDump => :backup_dir,
|
99
84
|
Procedures::Restore::PulpcoreDump => :backup_dir,
|
100
85
|
Procedures::Restore::ExtractFiles => :backup_dir)
|
101
|
-
|
102
|
-
context.map(:incremental_backup,
|
103
|
-
Procedures::Selinux::SetFileSecurity => :incremental_backup)
|
104
86
|
end
|
105
87
|
end
|
106
88
|
|
@@ -1,11 +1,10 @@
|
|
1
|
-
module Scenarios::
|
1
|
+
module Scenarios::Satellite
|
2
2
|
class Abstract < ForemanMaintain::Scenario
|
3
3
|
def self.upgrade_metadata(&block)
|
4
4
|
metadata do
|
5
5
|
tags :upgrade_scenario
|
6
6
|
confine do
|
7
|
-
feature(:
|
8
|
-
(feature(:satellite).current_minor_version == '6.15' || \
|
7
|
+
(feature(:downstream).current_minor_version == '6.15' || \
|
9
8
|
ForemanMaintain.upgrade_in_progress == '6.16')
|
10
9
|
end
|
11
10
|
instance_eval(&block)
|
@@ -19,7 +18,7 @@ module Scenarios::Satellite_6_16
|
|
19
18
|
|
20
19
|
class PreUpgradeCheck < Abstract
|
21
20
|
upgrade_metadata do
|
22
|
-
description 'Checks before upgrading
|
21
|
+
description 'Checks before upgrading'
|
23
22
|
tags :pre_upgrade_checks
|
24
23
|
run_strategy :fail_slow
|
25
24
|
end
|
@@ -27,15 +26,16 @@ module Scenarios::Satellite_6_16
|
|
27
26
|
def compose
|
28
27
|
add_steps(find_checks(:default))
|
29
28
|
add_steps(find_checks(:pre_upgrade))
|
29
|
+
add_step(Checks::CheckIpv6Disable)
|
30
30
|
add_step(Checks::Disk::AvailableSpacePostgresql13)
|
31
|
-
add_step(Checks::Repositories::Validate.new(:version =>
|
31
|
+
add_step(Checks::Repositories::Validate.new(:version => target_version))
|
32
32
|
add_step(Checks::CheckOrganizationContentAccessMode)
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
36
|
class PreMigrations < Abstract
|
37
37
|
upgrade_metadata do
|
38
|
-
description 'Procedures before migrating
|
38
|
+
description 'Procedures before migrating'
|
39
39
|
tags :pre_migrations
|
40
40
|
end
|
41
41
|
|
@@ -46,7 +46,7 @@ module Scenarios::Satellite_6_16
|
|
46
46
|
|
47
47
|
class Migrations < Abstract
|
48
48
|
upgrade_metadata do
|
49
|
-
description 'Migration scripts
|
49
|
+
description 'Migration scripts'
|
50
50
|
tags :migrations
|
51
51
|
run_strategy :fail_fast
|
52
52
|
end
|
@@ -56,7 +56,7 @@ module Scenarios::Satellite_6_16
|
|
56
56
|
end
|
57
57
|
|
58
58
|
def compose
|
59
|
-
add_step(Procedures::Repositories::Setup.new(:version =>
|
59
|
+
add_step(Procedures::Repositories::Setup.new(:version => target_version))
|
60
60
|
if el8?
|
61
61
|
modules_to_switch = ['postgresql:13']
|
62
62
|
add_step(Procedures::Packages::SwitchModules.new(:module_names => modules_to_switch))
|
@@ -76,7 +76,7 @@ module Scenarios::Satellite_6_16
|
|
76
76
|
|
77
77
|
class PostMigrations < Abstract
|
78
78
|
upgrade_metadata do
|
79
|
-
description 'Procedures after migrating
|
79
|
+
description 'Procedures after migrating'
|
80
80
|
tags :post_migrations
|
81
81
|
end
|
82
82
|
|
@@ -89,7 +89,7 @@ module Scenarios::Satellite_6_16
|
|
89
89
|
|
90
90
|
class PostUpgradeChecks < Abstract
|
91
91
|
upgrade_metadata do
|
92
|
-
description 'Checks after upgrading
|
92
|
+
description 'Checks after upgrading'
|
93
93
|
tags :post_upgrade_checks
|
94
94
|
run_strategy :fail_slow
|
95
95
|
end
|
@@ -98,6 +98,7 @@ module Scenarios::Satellite_6_16
|
|
98
98
|
add_steps(find_checks(:default))
|
99
99
|
add_steps(find_checks(:post_upgrade))
|
100
100
|
add_step(Procedures::Packages::CheckForReboot)
|
101
|
+
add_step(Procedures::Pulpcore::ContainerHandleImageMetadata)
|
101
102
|
end
|
102
103
|
end
|
103
104
|
end
|