foreman_maintain 0.5.4 → 0.6.4
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 +4 -0
- data/definitions/checks/check_hotfix_installed.rb +2 -1
- data/definitions/checks/disk/performance.rb +25 -10
- data/definitions/checks/foreman/validate_external_db_version.rb +28 -0
- data/definitions/checks/original_assets.rb +1 -0
- data/definitions/checks/pulpcore/db_up.rb +29 -0
- data/definitions/checks/repositories/check_non_rh_repository.rb +23 -0
- data/definitions/checks/repositories/check_upstream_repository.rb +2 -1
- data/definitions/checks/repositories/validate.rb +2 -1
- data/definitions/features/apache.rb +19 -0
- data/definitions/features/dynflow_sidekiq.rb +39 -0
- data/definitions/features/foreman_database.rb +5 -3
- data/definitions/features/foreman_proxy.rb +15 -4
- data/definitions/features/foreman_server.rb +9 -3
- data/definitions/features/foreman_tasks.rb +1 -1
- data/definitions/features/installer.rb +9 -2
- data/definitions/features/instance.rb +10 -3
- data/definitions/features/mongo.rb +1 -1
- data/definitions/features/{pulp.rb → pulp2.rb} +1 -1
- data/definitions/features/pulpcore.rb +28 -0
- data/definitions/features/pulpcore_database.rb +39 -0
- data/definitions/features/redis.rb +34 -0
- data/definitions/features/service.rb +10 -3
- data/definitions/features/tar.rb +18 -13
- data/definitions/procedures/backup/config_files.rb +43 -10
- data/definitions/procedures/backup/offline/pulpcore_db.rb +57 -0
- data/definitions/procedures/backup/online/pulpcore_db.rb +20 -0
- data/definitions/procedures/backup/pulp.rb +3 -3
- data/definitions/procedures/backup/snapshot/logical_volume_confirmation.rb +2 -1
- data/definitions/procedures/backup/snapshot/mount_pulp.rb +3 -3
- data/definitions/procedures/backup/snapshot/mount_pulpcore_db.rb +48 -0
- data/definitions/procedures/content/prepare.rb +12 -0
- data/definitions/procedures/content/switchover.rb +22 -0
- data/definitions/procedures/hammer_setup.rb +1 -1
- data/definitions/procedures/installer/run.rb +3 -1
- data/definitions/procedures/installer/upgrade.rb +6 -1
- data/definitions/procedures/packages/update.rb +1 -1
- data/definitions/procedures/pulp/migrate.rb +1 -1
- data/definitions/procedures/pulpcore/migrate.rb +25 -0
- data/definitions/procedures/restore/configs.rb +7 -0
- data/definitions/procedures/restore/drop_databases.rb +11 -1
- data/definitions/procedures/restore/mongo_dump.rb +2 -2
- data/definitions/procedures/restore/pulpcore_dump.rb +30 -0
- data/definitions/procedures/service/base.rb +1 -1
- data/definitions/procedures/service/stop.rb +1 -1
- data/definitions/scenarios/backup.rb +18 -3
- data/definitions/scenarios/content.rb +27 -0
- data/definitions/scenarios/packages.rb +36 -16
- data/definitions/scenarios/restore.rb +7 -1
- data/definitions/scenarios/upgrade_to_capsule_6_7.rb +88 -0
- data/definitions/scenarios/upgrade_to_capsule_6_7_z.rb +88 -0
- data/definitions/scenarios/upgrade_to_capsule_6_8.rb +88 -0
- data/definitions/scenarios/upgrade_to_capsule_6_8_z.rb +88 -0
- data/definitions/scenarios/upgrade_to_satellite_6_2.rb +13 -5
- data/definitions/scenarios/upgrade_to_satellite_6_2_z.rb +13 -5
- data/definitions/scenarios/upgrade_to_satellite_6_3.rb +13 -5
- data/definitions/scenarios/upgrade_to_satellite_6_3_z.rb +13 -5
- data/definitions/scenarios/upgrade_to_satellite_6_4.rb +13 -5
- data/definitions/scenarios/upgrade_to_satellite_6_4_z.rb +13 -5
- data/definitions/scenarios/upgrade_to_satellite_6_5.rb +13 -5
- data/definitions/scenarios/upgrade_to_satellite_6_5_z.rb +13 -5
- data/definitions/scenarios/upgrade_to_satellite_6_6.rb +13 -5
- data/definitions/scenarios/upgrade_to_satellite_6_6_z.rb +13 -5
- data/definitions/scenarios/upgrade_to_satellite_6_7.rb +13 -5
- data/definitions/scenarios/upgrade_to_satellite_6_7_z.rb +13 -5
- data/definitions/scenarios/upgrade_to_satellite_6_8.rb +88 -0
- data/definitions/scenarios/upgrade_to_satellite_6_8_z.rb +88 -0
- data/lib/foreman_maintain.rb +31 -0
- data/lib/foreman_maintain/cli.rb +2 -0
- data/lib/foreman_maintain/cli/content_command.rb +17 -0
- data/lib/foreman_maintain/cli/upgrade_command.rb +10 -0
- data/lib/foreman_maintain/concerns/base_database.rb +16 -1
- data/lib/foreman_maintain/concerns/downstream.rb +13 -8
- data/lib/foreman_maintain/concerns/system_helpers.rb +9 -7
- data/lib/foreman_maintain/package_manager/dnf.rb +11 -5
- data/lib/foreman_maintain/package_manager/yum.rb +15 -5
- data/lib/foreman_maintain/reporter/cli_reporter.rb +3 -3
- data/lib/foreman_maintain/upgrade_runner.rb +20 -26
- data/lib/foreman_maintain/utils/backup.rb +58 -62
- data/lib/foreman_maintain/utils/service/abstract.rb +8 -1
- data/lib/foreman_maintain/utils/service/systemd.rb +26 -2
- data/lib/foreman_maintain/version.rb +1 -1
- metadata +26 -4
- data/definitions/checks/check_epel_repository.rb +0 -21
@@ -0,0 +1,22 @@
|
|
1
|
+
module Procedures::Content
|
2
|
+
class Switchover < ForemanMaintain::Procedure
|
3
|
+
metadata do
|
4
|
+
description 'Switch support for certain content from Pulp 2 to Pulp 3'
|
5
|
+
for_feature :pulpcore
|
6
|
+
end
|
7
|
+
|
8
|
+
def run
|
9
|
+
puts 'Performing final content migration before switching content'
|
10
|
+
puts execute!('foreman-rake katello:pulp3_migration')
|
11
|
+
puts 'Performing a check to verify everything that is needed has been migrated'
|
12
|
+
puts execute!('foreman-rake katello:pulp3_post_migration_check')
|
13
|
+
puts 'Switching specified content over to pulp 3'
|
14
|
+
puts execute!('foreman-rake katello:pulp3_content_switchover')
|
15
|
+
puts 'Re-running the installer to switch specified content over to pulp3'
|
16
|
+
args = ['--foreman-proxy-content-proxy-pulp-isos-to-pulpcore=true',
|
17
|
+
'--katello-use-pulp-2-for-file=false',
|
18
|
+
'--katello-use-pulp-2-for-docker=false']
|
19
|
+
feature(:installer).run(args.join(' '))
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -5,7 +5,7 @@ class Procedures::HammerSetup < ForemanMaintain::Procedure
|
|
5
5
|
end
|
6
6
|
|
7
7
|
def run
|
8
|
-
if feature(:foreman_server) &&
|
8
|
+
if feature(:foreman_server) && feature(:foreman_server).services_running?
|
9
9
|
puts 'Configuring Hammer CLI...'
|
10
10
|
result = feature(:hammer).setup_admin_access
|
11
11
|
logger.info 'Hammer was configured successfully.' if result
|
@@ -2,10 +2,12 @@ module Procedures::Installer
|
|
2
2
|
class Run < ForemanMaintain::Procedure
|
3
3
|
metadata do
|
4
4
|
param :arguments, 'Arguments passed to installer'
|
5
|
+
param :assumeyes, 'Do not ask for confirmation'
|
5
6
|
end
|
6
7
|
|
7
8
|
def run
|
8
|
-
|
9
|
+
assumeyes_val = @assumeyes.nil? ? assumeyes? : @assumeyes
|
10
|
+
feature(:installer).run(@arguments, :interactive => !assumeyes_val)
|
9
11
|
end
|
10
12
|
|
11
13
|
def description
|
@@ -1,7 +1,12 @@
|
|
1
1
|
module Procedures::Installer
|
2
2
|
class Upgrade < ForemanMaintain::Procedure
|
3
|
+
metadata do
|
4
|
+
param :assumeyes, 'Do not ask for confirmation'
|
5
|
+
end
|
6
|
+
|
3
7
|
def run
|
4
|
-
|
8
|
+
assumeyes_val = @assumeyes.nil? ? assumeyes? : @assumeyes
|
9
|
+
feature(:installer).run(@arguments, :interactive => !assumeyes_val)
|
5
10
|
end
|
6
11
|
end
|
7
12
|
end
|
@@ -10,7 +10,7 @@ module Procedures::Packages
|
|
10
10
|
|
11
11
|
def run
|
12
12
|
assumeyes_val = @assumeyes.nil? ? assumeyes? : @assumeyes
|
13
|
-
package_manager.clean_cache
|
13
|
+
package_manager.clean_cache(:assumeyes => assumeyes_val)
|
14
14
|
packages_action(:update, @packages, :assumeyes => assumeyes_val)
|
15
15
|
rescue ForemanMaintain::Error::ExecutionError => e
|
16
16
|
if @warn_on_errors
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Procedures::Pulpcore
|
2
|
+
class Migrate < ForemanMaintain::Procedure
|
3
|
+
include ForemanMaintain::Concerns::SystemService
|
4
|
+
|
5
|
+
metadata do
|
6
|
+
description 'Migrate pulpcore db'
|
7
|
+
for_feature :pulpcore
|
8
|
+
end
|
9
|
+
|
10
|
+
def run
|
11
|
+
with_spinner('Migrating pulpcore') do |spinner|
|
12
|
+
necessary_services = feature(:pulpcore_database).services
|
13
|
+
pulp_services = feature(:pulpcore).services
|
14
|
+
|
15
|
+
feature(:service).handle_services(spinner, 'start', :only => necessary_services)
|
16
|
+
feature(:service).handle_services(spinner, 'stop', :only => pulp_services)
|
17
|
+
|
18
|
+
spinner.update('Migrating pulpcore database')
|
19
|
+
execute!('sudo PULP_SETTINGS=/etc/pulp/settings.py '\
|
20
|
+
'DJANGO_SETTINGS_MODULE=pulpcore.app.settings '\
|
21
|
+
'python3-django-admin migrate --noinput')
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -14,6 +14,7 @@ module Procedures::Restore
|
|
14
14
|
spinner.update('Restoring configs')
|
15
15
|
clean_conflicting_data
|
16
16
|
restore_configs(backup)
|
17
|
+
reset_qpid_jrnls
|
17
18
|
reload_configs
|
18
19
|
end
|
19
20
|
end
|
@@ -45,5 +46,11 @@ module Procedures::Restore
|
|
45
46
|
# tar is unable to --overwrite dir with symlink
|
46
47
|
execute('rm -rf /usr/share/foreman-proxy/.ssh')
|
47
48
|
end
|
49
|
+
|
50
|
+
def reset_qpid_jrnls
|
51
|
+
# on restore without pulp data qpid fails to start
|
52
|
+
# https://access.redhat.com/solutions/4645231
|
53
|
+
execute('rm -rf /var/lib/qpidd/.qpidd/qls/dat2/__db.00*')
|
54
|
+
end
|
48
55
|
end
|
49
56
|
end
|
@@ -8,7 +8,7 @@ module Procedures::Restore
|
|
8
8
|
:required => true
|
9
9
|
|
10
10
|
confine do
|
11
|
-
feature(:foreman_database) || feature(:candlepin_database)
|
11
|
+
feature(:foreman_database) || feature(:candlepin_database) || feature(:pulpcore_database)
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
@@ -19,6 +19,9 @@ 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
|
+
if feature(:pulpcore)
|
23
|
+
drop_pulpcore(backup, spinner)
|
24
|
+
end
|
22
25
|
end
|
23
26
|
end
|
24
27
|
|
@@ -35,5 +38,12 @@ module Procedures::Restore
|
|
35
38
|
feature(:candlepin_database).dropdb
|
36
39
|
end
|
37
40
|
end
|
41
|
+
|
42
|
+
def drop_pulpcore(backup, spinner)
|
43
|
+
if backup.file_map[:pulpcore_dump][:present]
|
44
|
+
spinner.update('Dropping pulpcore database')
|
45
|
+
feature(:pulpcore_database).dropdb
|
46
|
+
end
|
47
|
+
end
|
38
48
|
end
|
39
49
|
end
|
@@ -2,7 +2,7 @@ module Procedures::Restore
|
|
2
2
|
class MongoDump < ForemanMaintain::Procedure
|
3
3
|
metadata do
|
4
4
|
description 'Restore mongo dump'
|
5
|
-
for_feature :
|
5
|
+
for_feature :pulp2
|
6
6
|
param :backup_dir,
|
7
7
|
'Path to backup directory',
|
8
8
|
:required => true
|
@@ -10,7 +10,7 @@ module Procedures::Restore
|
|
10
10
|
[Checks::Mongo::DBUp.new, Checks::Mongo::ToolsInstalled.new]
|
11
11
|
end
|
12
12
|
confine do
|
13
|
-
feature(:mongo) && feature(:
|
13
|
+
feature(:mongo) && feature(:pulp2)
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module Procedures::Restore
|
2
|
+
class PulpcoreDump < ForemanMaintain::Procedure
|
3
|
+
metadata do
|
4
|
+
description 'Restore pulpcore postgresql dump from backup'
|
5
|
+
param :backup_dir,
|
6
|
+
'Path to backup directory',
|
7
|
+
:required => true
|
8
|
+
preparation_steps { Checks::Pulpcore::DBUp.new }
|
9
|
+
confine do
|
10
|
+
feature(:pulpcore_database)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def run
|
15
|
+
backup = ForemanMaintain::Utils::Backup.new(@backup_dir)
|
16
|
+
|
17
|
+
with_spinner('Restoring pulpcore postgresql dump') do |spinner|
|
18
|
+
restore_pulpcore_dump(backup, spinner)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def restore_pulpcore_dump(backup, spinner)
|
23
|
+
if backup.file_map[:pulpcore_dump][:present]
|
24
|
+
spinner.update('Restoring pulpcore dump')
|
25
|
+
local = feature(:pulpcore_database).local?
|
26
|
+
feature(:pulpcore_database).restore_dump(backup.file_map[:pulpcore_dump][:path], local)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -15,7 +15,7 @@ module Procedures
|
|
15
15
|
|
16
16
|
def run_service_action(action, options)
|
17
17
|
action_noun = feature(:service).action_noun(action).capitalize
|
18
|
-
puts "#{action_noun} the following service(s)
|
18
|
+
puts "\n#{action_noun} the following service(s):"
|
19
19
|
services = feature(:service).filtered_services(options)
|
20
20
|
print_services(services)
|
21
21
|
|
@@ -51,12 +51,15 @@ module ForemanMaintain::Scenarios
|
|
51
51
|
Procedures::Backup::Online::PgGlobalObjects => :backup_dir,
|
52
52
|
Procedures::Backup::Online::CandlepinDB => :backup_dir,
|
53
53
|
Procedures::Backup::Online::ForemanDB => :backup_dir,
|
54
|
+
Procedures::Backup::Online::PulpcoreDB => :backup_dir,
|
54
55
|
Procedures::Backup::Offline::CandlepinDB => :backup_dir,
|
55
56
|
Procedures::Backup::Offline::ForemanDB => :backup_dir,
|
57
|
+
Procedures::Backup::Offline::PulpcoreDB => :backup_dir,
|
56
58
|
Procedures::Backup::Offline::Mongo => :backup_dir,
|
57
59
|
Procedures::Backup::Snapshot::LogicalVolumeConfirmation => :backup_dir,
|
58
60
|
Procedures::Backup::Snapshot::MountCandlepinDB => :backup_dir,
|
59
61
|
Procedures::Backup::Snapshot::MountForemanDB => :backup_dir,
|
62
|
+
Procedures::Backup::Snapshot::MountPulpcoreDB => :backup_dir,
|
60
63
|
Procedures::Backup::Snapshot::MountMongo => :backup_dir)
|
61
64
|
context.map(:preserve_dir,
|
62
65
|
Checks::Backup::DirectoryReady => :preserve_dir,
|
@@ -73,15 +76,18 @@ module ForemanMaintain::Scenarios
|
|
73
76
|
Procedures::Backup::Snapshot::CleanMount => :mount_dir,
|
74
77
|
Procedures::Backup::Snapshot::MountCandlepinDB => :mount_dir,
|
75
78
|
Procedures::Backup::Snapshot::MountForemanDB => :mount_dir,
|
79
|
+
Procedures::Backup::Snapshot::MountPulpcoreDB => :mount_dir,
|
76
80
|
Procedures::Backup::Offline::Mongo => :mount_dir,
|
77
81
|
Procedures::Backup::Pulp => :mount_dir,
|
78
82
|
Procedures::Backup::Offline::CandlepinDB => :mount_dir,
|
79
|
-
Procedures::Backup::Offline::ForemanDB => :mount_dir
|
83
|
+
Procedures::Backup::Offline::ForemanDB => :mount_dir,
|
84
|
+
Procedures::Backup::Offline::PulpcoreDB => :mount_dir)
|
80
85
|
context.map(:snapshot_block_size,
|
81
86
|
Procedures::Backup::Snapshot::MountMongo => :block_size,
|
82
87
|
Procedures::Backup::Snapshot::MountPulp => :block_size,
|
83
88
|
Procedures::Backup::Snapshot::MountForemanDB => :block_size,
|
84
|
-
Procedures::Backup::Snapshot::MountCandlepinDB => :block_size
|
89
|
+
Procedures::Backup::Snapshot::MountCandlepinDB => :block_size,
|
90
|
+
Procedures::Backup::Snapshot::MountPulpcoreDB => :block_size)
|
85
91
|
context.map(:skip_pulp_content,
|
86
92
|
Procedures::Backup::Pulp => :skip,
|
87
93
|
Procedures::Backup::Snapshot::LogicalVolumeConfirmation => :skip_pulp,
|
@@ -135,6 +141,7 @@ module ForemanMaintain::Scenarios
|
|
135
141
|
Procedures::Backup::Offline::Mongo,
|
136
142
|
Procedures::Backup::Offline::CandlepinDB,
|
137
143
|
Procedures::Backup::Offline::ForemanDB,
|
144
|
+
Procedures::Backup::Offline::PulpcoreDB,
|
138
145
|
Procedures::Service::Start,
|
139
146
|
find_procedures(:maintenance_mode_off)
|
140
147
|
)
|
@@ -150,6 +157,9 @@ module ForemanMaintain::Scenarios
|
|
150
157
|
if feature(:instance).database_local?(:foreman_database)
|
151
158
|
add_step_with_context(Procedures::Backup::Online::ForemanDB)
|
152
159
|
end
|
160
|
+
if feature(:instance).database_local?(:pulpcore_database)
|
161
|
+
add_step_with_context(Procedures::Backup::Online::PulpcoreDB)
|
162
|
+
end
|
153
163
|
if feature(:instance).database_local?(:mongo)
|
154
164
|
add_step_with_context(Procedures::Backup::Online::Mongo)
|
155
165
|
end
|
@@ -168,6 +178,7 @@ module ForemanMaintain::Scenarios
|
|
168
178
|
Procedures::Backup::Snapshot::MountPulp,
|
169
179
|
Procedures::Backup::Snapshot::MountCandlepinDB,
|
170
180
|
Procedures::Backup::Snapshot::MountForemanDB,
|
181
|
+
Procedures::Backup::Snapshot::MountPulpcoreDB,
|
171
182
|
Procedures::Service::Start,
|
172
183
|
find_procedures(:maintenance_mode_off),
|
173
184
|
Procedures::Backup::Pulp
|
@@ -178,6 +189,9 @@ module ForemanMaintain::Scenarios
|
|
178
189
|
if feature(:instance).database_local?(:foreman_database)
|
179
190
|
add_step_with_context(Procedures::Backup::Offline::ForemanDB)
|
180
191
|
end
|
192
|
+
if feature(:instance).database_local?(:pulpcore_database)
|
193
|
+
add_step_with_context(Procedures::Backup::Offline::PulpcoreDB)
|
194
|
+
end
|
181
195
|
if feature(:instance).database_local?(:mongo)
|
182
196
|
add_step_with_context(Procedures::Backup::Offline::Mongo)
|
183
197
|
end
|
@@ -193,7 +207,8 @@ module ForemanMaintain::Scenarios
|
|
193
207
|
Procedures::Backup::Online::Mongo,
|
194
208
|
Procedures::Backup::Online::PgGlobalObjects,
|
195
209
|
Procedures::Backup::Online::CandlepinDB,
|
196
|
-
Procedures::Backup::Online::ForemanDB
|
210
|
+
Procedures::Backup::Online::ForemanDB,
|
211
|
+
Procedures::Backup::Online::PulpcoreDB
|
197
212
|
)
|
198
213
|
end
|
199
214
|
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module ForemanMaintain::Scenarios
|
2
|
+
module Content
|
3
|
+
class Prepare < ForemanMaintain::Scenario
|
4
|
+
metadata do
|
5
|
+
label :content_prepare
|
6
|
+
description 'Prepare content for Pulp 3'
|
7
|
+
manual_detection
|
8
|
+
end
|
9
|
+
|
10
|
+
def compose
|
11
|
+
add_step(Procedures::Content::Prepare)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
class Switchover < ForemanMaintain::Scenario
|
16
|
+
metadata do
|
17
|
+
label :content_switchover
|
18
|
+
description 'Switch support for certain content from Pulp 2 to Pulp 3'
|
19
|
+
manual_detection
|
20
|
+
end
|
21
|
+
|
22
|
+
def compose
|
23
|
+
add_step(Procedures::Content::Switchover)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -1,5 +1,16 @@
|
|
1
1
|
module ForemanMaintain::Scenarios
|
2
2
|
module Packages
|
3
|
+
def self.skip_installer_run?(packages_list)
|
4
|
+
packages_list = packages_list.split(',').map(&:strip) if packages_list.is_a?(String)
|
5
|
+
|
6
|
+
return false unless packages_list.any? { |p| p.include?('foreman_maintain') }
|
7
|
+
return true if packages_list.length == 1
|
8
|
+
|
9
|
+
fm_pkg = ForemanMaintain.main_package_name
|
10
|
+
puts "ERROR: install or update '#{fm_pkg}' package individually."
|
11
|
+
exit 1
|
12
|
+
end
|
13
|
+
|
3
14
|
class Status < ForemanMaintain::Scenario
|
4
15
|
metadata do
|
5
16
|
label :packages_status
|
@@ -45,13 +56,17 @@ module ForemanMaintain::Scenarios
|
|
45
56
|
end
|
46
57
|
|
47
58
|
def compose
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
59
|
+
if Packages.skip_installer_run?(context.get(:packages))
|
60
|
+
add_step_with_context(Procedures::Packages::Install,
|
61
|
+
:force => true, :warn_on_errors => true)
|
62
|
+
else
|
63
|
+
add_step_with_context(Procedures::Packages::InstallerConfirmation)
|
64
|
+
add_step_with_context(Procedures::Packages::UnlockVersions)
|
65
|
+
add_step_with_context(Procedures::Packages::Install,
|
66
|
+
:force => true, :warn_on_errors => true)
|
67
|
+
add_step_with_context(Procedures::Installer::Upgrade)
|
68
|
+
add_step(Procedures::Packages::LockingStatus)
|
69
|
+
end
|
55
70
|
end
|
56
71
|
|
57
72
|
def set_context_mapping
|
@@ -71,15 +86,20 @@ module ForemanMaintain::Scenarios
|
|
71
86
|
end
|
72
87
|
|
73
88
|
def compose
|
74
|
-
|
75
|
-
Procedures::Packages::
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
89
|
+
if Packages.skip_installer_run?(context.get(:packages))
|
90
|
+
add_step_with_context(Procedures::Packages::Update,
|
91
|
+
:force => true, :warn_on_errors => true)
|
92
|
+
else
|
93
|
+
add_steps_with_context(
|
94
|
+
Procedures::Packages::UpdateAllConfirmation,
|
95
|
+
Procedures::Packages::InstallerConfirmation,
|
96
|
+
Procedures::Packages::UnlockVersions
|
97
|
+
)
|
98
|
+
add_step_with_context(Procedures::Packages::Update,
|
99
|
+
:force => true, :warn_on_errors => true)
|
100
|
+
add_step_with_context(Procedures::Installer::Upgrade)
|
101
|
+
add_step(Procedures::Packages::LockingStatus)
|
102
|
+
end
|
83
103
|
end
|
84
104
|
|
85
105
|
def set_context_mapping
|
@@ -36,6 +36,7 @@ module ForemanMaintain::Scenarios
|
|
36
36
|
end
|
37
37
|
restore_mongo_dump(backup)
|
38
38
|
add_steps_with_context(Procedures::Pulp::Migrate,
|
39
|
+
Procedures::Pulpcore::Migrate,
|
39
40
|
Procedures::Service::Start,
|
40
41
|
Procedures::Service::DaemonReload)
|
41
42
|
end
|
@@ -43,7 +44,8 @@ module ForemanMaintain::Scenarios
|
|
43
44
|
|
44
45
|
def drop_dbs(backup)
|
45
46
|
if backup.file_map[:candlepin_dump][:present] ||
|
46
|
-
backup.file_map[:foreman_dump][:present]
|
47
|
+
backup.file_map[:foreman_dump][:present] ||
|
48
|
+
(feature(:pulpcore) && backup.file_map[:pulpcore_dump][:present])
|
47
49
|
add_steps_with_context(Procedures::Restore::DropDatabases)
|
48
50
|
end
|
49
51
|
end
|
@@ -58,6 +60,9 @@ module ForemanMaintain::Scenarios
|
|
58
60
|
if backup.file_map[:foreman_dump][:present]
|
59
61
|
add_steps_with_context(Procedures::Restore::ForemanDump)
|
60
62
|
end
|
63
|
+
if feature(:pulpcore) && backup.file_map[:pulpcore_dump][:present]
|
64
|
+
add_steps_with_context(Procedures::Restore::PulpcoreDump)
|
65
|
+
end
|
61
66
|
end
|
62
67
|
|
63
68
|
def restore_mongo_dump(backup)
|
@@ -83,6 +88,7 @@ module ForemanMaintain::Scenarios
|
|
83
88
|
Procedures::Restore::PgGlobalObjects => :backup_dir,
|
84
89
|
Procedures::Restore::CandlepinDump => :backup_dir,
|
85
90
|
Procedures::Restore::ForemanDump => :backup_dir,
|
91
|
+
Procedures::Restore::PulpcoreDump => :backup_dir,
|
86
92
|
Procedures::Restore::ExtractFiles => :backup_dir,
|
87
93
|
Procedures::Restore::MongoDump => :backup_dir)
|
88
94
|
|