foreman_maintain 1.3.0 → 1.3.2
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 +0 -4
- data/bin/foreman-maintain +1 -1
- data/bin/foreman-maintain-complete +5 -5
- data/definitions/checks/backup/directory_ready.rb +3 -1
- data/definitions/checks/candlepin/db_up.rb +1 -1
- data/definitions/checks/candlepin/validate_db.rb +2 -9
- data/definitions/checks/check_for_newer_packages.rb +5 -5
- data/definitions/checks/check_hotfix_installed.rb +3 -7
- data/definitions/checks/disk/available_space_postgresql12.rb +3 -2
- data/definitions/checks/disk/performance.rb +3 -3
- data/definitions/checks/foreman/check_corrupted_roles.rb +2 -4
- data/definitions/checks/foreman/check_duplicate_permission.rb +1 -1
- data/definitions/checks/foreman/check_duplicate_roles.rb +1 -1
- data/definitions/checks/foreman/check_tuning_requirements.rb +1 -1
- data/definitions/checks/foreman/db_up.rb +1 -1
- data/definitions/checks/foreman/facts_names.rb +4 -4
- data/definitions/checks/foreman_openscap/invalid_report_associations.rb +4 -4
- data/definitions/checks/foreman_proxy/check_tftp_storage.rb +4 -4
- data/definitions/checks/foreman_proxy/verify_dhcp_config_syntax.rb +1 -2
- data/definitions/checks/foreman_tasks/invalid/check_old.rb +2 -2
- data/definitions/checks/foreman_tasks/invalid/check_pending_state.rb +2 -2
- data/definitions/checks/foreman_tasks/invalid/check_planning_state.rb +2 -2
- data/definitions/checks/foreman_tasks/not_paused.rb +2 -2
- data/definitions/checks/foreman_tasks/not_running.rb +6 -6
- data/definitions/checks/original_assets.rb +3 -3
- data/definitions/checks/package_manager/yum/validate_yum_config.rb +1 -1
- data/definitions/checks/pulpcore/db_up.rb +1 -1
- data/definitions/checks/repositories/check_upstream_repository.rb +2 -2
- data/definitions/checks/repositories/validate.rb +2 -2
- data/definitions/checks/restore/validate_backup.rb +2 -2
- data/definitions/checks/restore/validate_hostname.rb +2 -2
- data/definitions/checks/restore/validate_interfaces.rb +2 -2
- data/definitions/checks/restore/validate_postgresql_dump_permissions.rb +31 -0
- data/definitions/checks/services_up.rb +2 -2
- data/definitions/features/apache.rb +1 -1
- data/definitions/features/candlepin.rb +1 -1
- data/definitions/features/candlepin_database.rb +2 -4
- data/definitions/features/cron.rb +3 -5
- data/definitions/features/dynflow_sidekiq.rb +2 -2
- data/definitions/features/foreman_cockpit.rb +1 -1
- data/definitions/features/foreman_database.rb +1 -1
- data/definitions/features/foreman_proxy.rb +1 -1
- data/definitions/features/foreman_server.rb +3 -7
- data/definitions/features/foreman_tasks.rb +9 -12
- data/definitions/features/gofer.rb +1 -1
- data/definitions/features/hammer.rb +4 -4
- data/definitions/features/installer.rb +4 -5
- data/definitions/features/instance.rb +12 -14
- data/definitions/features/katello.rb +8 -12
- data/definitions/features/pulpcore.rb +6 -30
- data/definitions/features/pulpcore_database.rb +3 -1
- data/definitions/features/puppet_server.rb +1 -1
- data/definitions/features/redis.rb +2 -18
- data/definitions/features/salt_server.rb +1 -1
- data/definitions/features/service.rb +4 -48
- data/definitions/features/sync_plans.rb +2 -2
- data/definitions/features/tar.rb +4 -3
- data/definitions/procedures/backup/compress_data.rb +0 -1
- data/definitions/procedures/backup/config_files.rb +6 -5
- data/definitions/procedures/backup/prepare_directory.rb +0 -2
- data/definitions/procedures/backup/pulp.rb +3 -3
- data/definitions/procedures/backup/snapshot/clean_mount.rb +1 -1
- data/definitions/procedures/backup/snapshot/logical_volume_confirmation.rb +1 -2
- data/definitions/procedures/backup/snapshot/mount_pulp.rb +2 -2
- data/definitions/procedures/foreman/fix_corrupted_roles.rb +3 -3
- data/definitions/procedures/foreman_tasks/delete.rb +3 -3
- data/definitions/procedures/hammer_setup.rb +1 -1
- data/definitions/procedures/knowledge_base_article.rb +3 -4
- data/definitions/procedures/packages/enable_modules.rb +1 -1
- data/definitions/procedures/packages/install.rb +1 -1
- data/definitions/procedures/packages/uninstall.rb +1 -1
- data/definitions/procedures/packages/update.rb +6 -2
- data/definitions/procedures/pulpcore/migrate.rb +2 -3
- data/definitions/procedures/pulpcore/trim_rpm_changelogs.rb +2 -3
- data/definitions/procedures/remote_execution/remove_existing_settingsd.rb +2 -2
- data/definitions/procedures/repositories/enable.rb +1 -1
- data/definitions/procedures/repositories/setup.rb +2 -2
- data/definitions/procedures/restore/candlepin_dump.rb +2 -2
- data/definitions/procedures/restore/configs.rb +3 -10
- data/definitions/procedures/restore/drop_databases.rb +2 -2
- data/definitions/procedures/restore/extract_files.rb +4 -17
- data/definitions/procedures/restore/foreman_dump.rb +2 -2
- data/definitions/procedures/restore/installer_reset.rb +1 -2
- data/definitions/procedures/restore/postgres_owner.rb +2 -2
- data/definitions/procedures/restore/pulpcore_dump.rb +2 -2
- data/definitions/procedures/selinux/set_file_security.rb +2 -2
- data/definitions/procedures/service/restart.rb +2 -3
- data/definitions/scenarios/backup.rb +47 -65
- data/definitions/scenarios/packages.rb +9 -9
- data/definitions/scenarios/restore.rb +24 -40
- data/definitions/scenarios/self_upgrade.rb +7 -11
- data/definitions/scenarios/services.rb +17 -17
- data/definitions/scenarios/upgrade_to_capsule_6_14.rb +3 -2
- data/definitions/scenarios/upgrade_to_capsule_6_14_z.rb +3 -2
- data/definitions/scenarios/upgrade_to_katello_nightly.rb +3 -0
- data/definitions/scenarios/upgrade_to_satellite_6_14.rb +3 -2
- data/definitions/scenarios/upgrade_to_satellite_6_14_z.rb +3 -2
- data/extras/foreman_protector/dnf/foreman-protector.py +4 -4
- data/extras/foreman_protector/foreman-protector.whitelist +0 -6
- data/lib/foreman_maintain/cli/advanced/prebuild_bash_completion.rb +1 -1
- data/lib/foreman_maintain/cli/advanced_command.rb +2 -2
- data/lib/foreman_maintain/cli/backup_command.rb +17 -17
- data/lib/foreman_maintain/cli/base.rb +13 -13
- data/lib/foreman_maintain/cli/maintenance_mode_command.rb +1 -1
- data/lib/foreman_maintain/cli/plugin_command.rb +1 -1
- data/lib/foreman_maintain/cli/restore_command.rb +4 -4
- data/lib/foreman_maintain/cli/self_upgrade_command.rb +2 -2
- data/lib/foreman_maintain/cli/service_command.rb +2 -2
- data/lib/foreman_maintain/cli/transform_clamp_options.rb +1 -1
- data/lib/foreman_maintain/cli/upgrade_command.rb +7 -7
- data/lib/foreman_maintain/cli.rb +1 -11
- data/lib/foreman_maintain/concerns/base_database.rb +8 -17
- data/lib/foreman_maintain/concerns/downstream.rb +6 -64
- data/lib/foreman_maintain/concerns/firewall/iptables_maintenance_mode.rb +1 -1
- data/lib/foreman_maintain/concerns/foreman_and_katello_version_map.rb +1 -1
- data/lib/foreman_maintain/concerns/os_facts.rb +0 -8
- data/lib/foreman_maintain/concerns/primary_checks.rb +6 -5
- data/lib/foreman_maintain/concerns/pulp_common.rb +5 -8
- data/lib/foreman_maintain/concerns/system_helpers.rb +3 -6
- data/lib/foreman_maintain/concerns/upstream.rb +3 -3
- data/lib/foreman_maintain/config.rb +7 -7
- data/lib/foreman_maintain/core_ext.rb +2 -2
- data/lib/foreman_maintain/executable.rb +7 -9
- data/lib/foreman_maintain/package_manager/apt.rb +2 -2
- data/lib/foreman_maintain/package_manager/base.rb +0 -2
- data/lib/foreman_maintain/package_manager/dnf.rb +2 -2
- data/lib/foreman_maintain/package_manager/yum.rb +3 -4
- data/lib/foreman_maintain/package_manager.rb +7 -9
- data/lib/foreman_maintain/param.rb +2 -2
- data/lib/foreman_maintain/reporter/cli_reporter.rb +6 -7
- data/lib/foreman_maintain/reporter.rb +15 -10
- data/lib/foreman_maintain/repository_manager/el.rb +2 -10
- data/lib/foreman_maintain/repository_manager.rb +2 -1
- data/lib/foreman_maintain/runner.rb +5 -5
- data/lib/foreman_maintain/scenario.rb +4 -2
- data/lib/foreman_maintain/upgrade_runner.rb +0 -2
- data/lib/foreman_maintain/utils/backup.rb +27 -111
- data/lib/foreman_maintain/utils/bash.rb +18 -19
- data/lib/foreman_maintain/utils/command_runner.rb +5 -9
- data/lib/foreman_maintain/utils/hash_tools.rb +5 -5
- data/lib/foreman_maintain/utils/response.rb +1 -0
- data/lib/foreman_maintain/utils/service/remote_db.rb +1 -0
- data/lib/foreman_maintain/utils/service/systemd.rb +7 -5
- data/lib/foreman_maintain/utils/service.rb +1 -1
- data/lib/foreman_maintain/utils.rb +0 -1
- data/lib/foreman_maintain/version.rb +1 -1
- data/lib/foreman_maintain/yaml_storage.rb +1 -0
- data/lib/foreman_maintain.rb +7 -6
- metadata +29 -78
- data/definitions/checks/foreman/check_https_proxies.rb +0 -34
- data/definitions/checks/mongo/db_up.rb +0 -33
- data/definitions/checks/mongo/tools_installed.rb +0 -31
- data/definitions/checks/pulpcore/group_ownership_check.rb +0 -18
- data/definitions/checks/puppet/provide_upgrade_guide.rb +0 -35
- data/definitions/checks/puppet/warn_about_puppet_removal.rb +0 -35
- data/definitions/checks/remote_execution/verify_settings_file_already_exists.rb +0 -42
- data/definitions/features/mongo.rb +0 -217
- data/definitions/features/pulp2.rb +0 -35
- data/definitions/procedures/backup/offline/mongo.rb +0 -56
- data/definitions/procedures/backup/online/mongo.rb +0 -21
- data/definitions/procedures/backup/snapshot/mount_mongo.rb +0 -43
- data/definitions/procedures/candlepin/delete_orphaned_records_from_env_content.rb +0 -40
- data/definitions/procedures/content/fix_pulpcore_artifact_permissions.rb +0 -31
- data/definitions/procedures/content/migration_reset.rb +0 -12
- data/definitions/procedures/content/migration_stats.rb +0 -12
- data/definitions/procedures/content/prepare.rb +0 -17
- data/definitions/procedures/content/prepare_abort.rb +0 -12
- data/definitions/procedures/content/switchover.rb +0 -41
- data/definitions/procedures/prep_6_10_upgrade.rb +0 -29
- data/definitions/procedures/pulp/cleanup_old_metadata_files.rb +0 -75
- data/definitions/procedures/pulp/migrate.rb +0 -23
- data/definitions/procedures/pulp/print_remove_instructions.rb +0 -16
- data/definitions/procedures/pulp/remove.rb +0 -222
- data/definitions/procedures/restore/ensure_mongo_engine_matches.rb +0 -35
- data/definitions/procedures/restore/mongo_dump.rb +0 -41
- data/definitions/procedures/restore/regenerate_queues.rb +0 -69
- data/definitions/scenarios/content.rb +0 -158
- data/definitions/scenarios/prep_6_10_upgrade.rb +0 -13
- data/definitions/scenarios/upgrade_to_capsule_6_10.rb +0 -89
- data/definitions/scenarios/upgrade_to_capsule_6_10_z.rb +0 -88
- data/definitions/scenarios/upgrade_to_capsule_6_11.rb +0 -91
- data/definitions/scenarios/upgrade_to_capsule_6_11_z.rb +0 -90
- data/definitions/scenarios/upgrade_to_capsule_6_12.rb +0 -92
- data/definitions/scenarios/upgrade_to_capsule_6_12_z.rb +0 -92
- data/definitions/scenarios/upgrade_to_capsule_6_13.rb +0 -92
- data/definitions/scenarios/upgrade_to_capsule_6_13_z.rb +0 -92
- data/definitions/scenarios/upgrade_to_capsule_6_8.rb +0 -88
- data/definitions/scenarios/upgrade_to_capsule_6_8_z.rb +0 -88
- data/definitions/scenarios/upgrade_to_capsule_6_9.rb +0 -88
- data/definitions/scenarios/upgrade_to_capsule_6_9_z.rb +0 -88
- data/definitions/scenarios/upgrade_to_satellite_6_10.rb +0 -113
- data/definitions/scenarios/upgrade_to_satellite_6_10_z.rb +0 -89
- data/definitions/scenarios/upgrade_to_satellite_6_11.rb +0 -96
- data/definitions/scenarios/upgrade_to_satellite_6_11_z.rb +0 -91
- data/definitions/scenarios/upgrade_to_satellite_6_12.rb +0 -95
- data/definitions/scenarios/upgrade_to_satellite_6_12_z.rb +0 -94
- data/definitions/scenarios/upgrade_to_satellite_6_13.rb +0 -95
- data/definitions/scenarios/upgrade_to_satellite_6_13_z.rb +0 -94
- data/definitions/scenarios/upgrade_to_satellite_6_2.rb +0 -88
- data/definitions/scenarios/upgrade_to_satellite_6_2_z.rb +0 -88
- data/definitions/scenarios/upgrade_to_satellite_6_3.rb +0 -89
- data/definitions/scenarios/upgrade_to_satellite_6_3_z.rb +0 -88
- data/definitions/scenarios/upgrade_to_satellite_6_4.rb +0 -89
- data/definitions/scenarios/upgrade_to_satellite_6_4_z.rb +0 -88
- data/definitions/scenarios/upgrade_to_satellite_6_5.rb +0 -88
- data/definitions/scenarios/upgrade_to_satellite_6_5_z.rb +0 -88
- data/definitions/scenarios/upgrade_to_satellite_6_6.rb +0 -90
- data/definitions/scenarios/upgrade_to_satellite_6_6_z.rb +0 -90
- data/definitions/scenarios/upgrade_to_satellite_6_7.rb +0 -88
- data/definitions/scenarios/upgrade_to_satellite_6_7_z.rb +0 -88
- data/definitions/scenarios/upgrade_to_satellite_6_8.rb +0 -91
- data/definitions/scenarios/upgrade_to_satellite_6_8_z.rb +0 -89
- data/definitions/scenarios/upgrade_to_satellite_6_9.rb +0 -91
- data/definitions/scenarios/upgrade_to_satellite_6_9_z.rb +0 -89
- data/lib/foreman_maintain/cli/content_command.rb +0 -69
- data/lib/foreman_maintain/utils/mongo_core.rb +0 -86
|
@@ -6,7 +6,7 @@ module ForemanMaintain::Scenarios
|
|
|
6
6
|
tags :backup
|
|
7
7
|
run_strategy :fail_fast
|
|
8
8
|
param :strategy, 'Backup strategy. One of [:online, :offline, :snapshot]',
|
|
9
|
-
|
|
9
|
+
:required => true
|
|
10
10
|
param :backup_dir, 'Directory where to backup to', :required => true
|
|
11
11
|
param :mount_dir, 'Snapshot mount directory'
|
|
12
12
|
param :include_db_dumps, 'Include dumps of local dbs as part of offline'
|
|
@@ -19,7 +19,6 @@ module ForemanMaintain::Scenarios
|
|
|
19
19
|
param :tar_volume_size, 'Size of tar volume (indicates splitting)'
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
-
# rubocop:disable Metrics/MethodLength
|
|
23
22
|
def compose
|
|
24
23
|
check_valid_startegy
|
|
25
24
|
safety_confirmation
|
|
@@ -39,7 +38,6 @@ module ForemanMaintain::Scenarios
|
|
|
39
38
|
end
|
|
40
39
|
add_step_with_context(Procedures::Backup::CompressData)
|
|
41
40
|
end
|
|
42
|
-
# rubocop:enable Metrics/MethodLength
|
|
43
41
|
|
|
44
42
|
def deb_snapshot_msg
|
|
45
43
|
if debian_or_ubuntu?
|
|
@@ -51,70 +49,63 @@ module ForemanMaintain::Scenarios
|
|
|
51
49
|
# rubocop:disable Metrics/MethodLength
|
|
52
50
|
def set_context_mapping
|
|
53
51
|
context.map(:backup_dir,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
Procedures::Backup::Snapshot::MountForemanDB => :backup_dir,
|
|
71
|
-
Procedures::Backup::Snapshot::MountPulpcoreDB => :backup_dir,
|
|
72
|
-
Procedures::Backup::Snapshot::MountMongo => :backup_dir)
|
|
52
|
+
Checks::Backup::DirectoryReady => :backup_dir,
|
|
53
|
+
Procedures::Backup::PrepareDirectory => :backup_dir,
|
|
54
|
+
Procedures::Backup::Metadata => :backup_dir,
|
|
55
|
+
Procedures::Backup::ConfigFiles => :backup_dir,
|
|
56
|
+
Procedures::Backup::CompressData => :backup_dir,
|
|
57
|
+
Procedures::Backup::Pulp => :backup_dir,
|
|
58
|
+
Procedures::Backup::Online::CandlepinDB => :backup_dir,
|
|
59
|
+
Procedures::Backup::Online::ForemanDB => :backup_dir,
|
|
60
|
+
Procedures::Backup::Online::PulpcoreDB => :backup_dir,
|
|
61
|
+
Procedures::Backup::Offline::CandlepinDB => :backup_dir,
|
|
62
|
+
Procedures::Backup::Offline::ForemanDB => :backup_dir,
|
|
63
|
+
Procedures::Backup::Offline::PulpcoreDB => :backup_dir,
|
|
64
|
+
Procedures::Backup::Snapshot::LogicalVolumeConfirmation => :backup_dir,
|
|
65
|
+
Procedures::Backup::Snapshot::MountCandlepinDB => :backup_dir,
|
|
66
|
+
Procedures::Backup::Snapshot::MountForemanDB => :backup_dir,
|
|
67
|
+
Procedures::Backup::Snapshot::MountPulpcoreDB => :backup_dir)
|
|
73
68
|
context.map(:preserve_dir,
|
|
74
|
-
|
|
75
|
-
|
|
69
|
+
Checks::Backup::DirectoryReady => :preserve_dir,
|
|
70
|
+
Procedures::Backup::PrepareDirectory => :preserve_dir)
|
|
76
71
|
context.map(:incremental_dir,
|
|
77
|
-
|
|
78
|
-
|
|
72
|
+
Procedures::Backup::PrepareDirectory => :incremental_dir,
|
|
73
|
+
Procedures::Backup::Metadata => :incremental_dir)
|
|
79
74
|
context.map(:proxy_features,
|
|
80
|
-
|
|
75
|
+
Procedures::Backup::ConfigFiles => :proxy_features)
|
|
81
76
|
context.map(:snapshot_mount_dir,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
Procedures::Backup::Offline::ForemanDB => :mount_dir,
|
|
93
|
-
Procedures::Backup::Offline::PulpcoreDB => :mount_dir)
|
|
77
|
+
Procedures::Backup::Snapshot::PrepareMount => :mount_dir,
|
|
78
|
+
Procedures::Backup::Snapshot::MountPulp => :mount_dir,
|
|
79
|
+
Procedures::Backup::Snapshot::CleanMount => :mount_dir,
|
|
80
|
+
Procedures::Backup::Snapshot::MountCandlepinDB => :mount_dir,
|
|
81
|
+
Procedures::Backup::Snapshot::MountForemanDB => :mount_dir,
|
|
82
|
+
Procedures::Backup::Snapshot::MountPulpcoreDB => :mount_dir,
|
|
83
|
+
Procedures::Backup::Pulp => :mount_dir,
|
|
84
|
+
Procedures::Backup::Offline::CandlepinDB => :mount_dir,
|
|
85
|
+
Procedures::Backup::Offline::ForemanDB => :mount_dir,
|
|
86
|
+
Procedures::Backup::Offline::PulpcoreDB => :mount_dir)
|
|
94
87
|
context.map(:snapshot_block_size,
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
Procedures::Backup::Snapshot::MountPulpcoreDB => :block_size)
|
|
88
|
+
Procedures::Backup::Snapshot::MountPulp => :block_size,
|
|
89
|
+
Procedures::Backup::Snapshot::MountForemanDB => :block_size,
|
|
90
|
+
Procedures::Backup::Snapshot::MountCandlepinDB => :block_size,
|
|
91
|
+
Procedures::Backup::Snapshot::MountPulpcoreDB => :block_size)
|
|
100
92
|
context.map(:skip_pulp_content,
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
93
|
+
Procedures::Backup::Pulp => :skip,
|
|
94
|
+
Procedures::Backup::Snapshot::LogicalVolumeConfirmation => :skip_pulp,
|
|
95
|
+
Procedures::Backup::Snapshot::MountPulp => :skip)
|
|
104
96
|
context.map(:tar_volume_size,
|
|
105
|
-
|
|
97
|
+
Procedures::Backup::Pulp => :tar_volume_size)
|
|
106
98
|
context.map(:include_db_dumps,
|
|
107
|
-
|
|
99
|
+
Procedures::Backup::Online::SafetyConfirmation => :include_db_dumps)
|
|
108
100
|
end
|
|
109
101
|
# rubocop:enable Metrics/MethodLength
|
|
110
102
|
|
|
111
103
|
private
|
|
112
104
|
|
|
113
105
|
def prepare_directory
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
)
|
|
106
|
+
add_step_with_context(Procedures::Backup::PrepareDirectory)
|
|
107
|
+
add_step_with_context(Checks::Backup::DirectoryReady,
|
|
108
|
+
:postgres_access => online_backup? || include_db_dumps?)
|
|
118
109
|
end
|
|
119
110
|
|
|
120
111
|
def logical_volume_confirmation
|
|
@@ -149,7 +140,6 @@ module ForemanMaintain::Scenarios
|
|
|
149
140
|
Procedures::Service::Stop,
|
|
150
141
|
Procedures::Backup::ConfigFiles,
|
|
151
142
|
Procedures::Backup::Pulp,
|
|
152
|
-
Procedures::Backup::Offline::Mongo,
|
|
153
143
|
Procedures::Backup::Offline::CandlepinDB,
|
|
154
144
|
Procedures::Backup::Offline::ForemanDB,
|
|
155
145
|
Procedures::Backup::Offline::PulpcoreDB,
|
|
@@ -168,9 +158,6 @@ module ForemanMaintain::Scenarios
|
|
|
168
158
|
if feature(:instance).database_local?(:pulpcore_database)
|
|
169
159
|
add_step_with_context(Procedures::Backup::Online::PulpcoreDB)
|
|
170
160
|
end
|
|
171
|
-
if feature(:instance).database_local?(:mongo)
|
|
172
|
-
add_step_with_context(Procedures::Backup::Online::Mongo)
|
|
173
|
-
end
|
|
174
161
|
end
|
|
175
162
|
|
|
176
163
|
# rubocop:disable Metrics/MethodLength
|
|
@@ -182,7 +169,6 @@ module ForemanMaintain::Scenarios
|
|
|
182
169
|
find_procedures(:maintenance_mode_on),
|
|
183
170
|
Procedures::Service::Stop,
|
|
184
171
|
Procedures::Backup::ConfigFiles,
|
|
185
|
-
Procedures::Backup::Snapshot::MountMongo,
|
|
186
172
|
Procedures::Backup::Snapshot::MountPulp,
|
|
187
173
|
Procedures::Backup::Snapshot::MountCandlepinDB,
|
|
188
174
|
Procedures::Backup::Snapshot::MountForemanDB,
|
|
@@ -200,9 +186,6 @@ module ForemanMaintain::Scenarios
|
|
|
200
186
|
if feature(:instance).database_local?(:pulpcore_database)
|
|
201
187
|
add_step_with_context(Procedures::Backup::Offline::PulpcoreDB)
|
|
202
188
|
end
|
|
203
|
-
if feature(:instance).database_local?(:mongo)
|
|
204
|
-
add_step_with_context(Procedures::Backup::Offline::Mongo)
|
|
205
|
-
end
|
|
206
189
|
add_step_with_context(Procedures::Backup::Snapshot::CleanMount)
|
|
207
190
|
end
|
|
208
191
|
# rubocop:enable Metrics/MethodLength
|
|
@@ -212,7 +195,6 @@ module ForemanMaintain::Scenarios
|
|
|
212
195
|
:online_backup => true)
|
|
213
196
|
add_step_with_context(Procedures::Backup::Pulp, :ensure_unchanged => true)
|
|
214
197
|
add_steps_with_context(
|
|
215
|
-
Procedures::Backup::Online::Mongo,
|
|
216
198
|
Procedures::Backup::Online::CandlepinDB,
|
|
217
199
|
Procedures::Backup::Online::ForemanDB,
|
|
218
200
|
Procedures::Backup::Online::PulpcoreDB
|
|
@@ -253,11 +235,11 @@ module ForemanMaintain::Scenarios
|
|
|
253
235
|
|
|
254
236
|
def set_context_mapping
|
|
255
237
|
context.map(:snapshot_mount_dir,
|
|
256
|
-
|
|
238
|
+
Procedures::Backup::Snapshot::CleanMount => :mount_dir)
|
|
257
239
|
context.map(:backup_dir,
|
|
258
|
-
|
|
240
|
+
Procedures::Backup::Clean => :backup_dir)
|
|
259
241
|
context.map(:preserve_dir,
|
|
260
|
-
|
|
242
|
+
Procedures::Backup::Clean => :preserve_dir)
|
|
261
243
|
end
|
|
262
244
|
|
|
263
245
|
private
|
|
@@ -73,12 +73,12 @@ module ForemanMaintain::Scenarios
|
|
|
73
73
|
def compose
|
|
74
74
|
if Packages.skip_installer_run?(context.get(:packages))
|
|
75
75
|
add_step_with_context(Procedures::Packages::Install,
|
|
76
|
-
|
|
76
|
+
:force => true, :warn_on_errors => true)
|
|
77
77
|
else
|
|
78
78
|
add_step_with_context(Procedures::Packages::InstallerConfirmation)
|
|
79
79
|
add_step_with_context(Procedures::Packages::UnlockVersions)
|
|
80
80
|
add_step_with_context(Procedures::Packages::Install,
|
|
81
|
-
|
|
81
|
+
:force => true, :warn_on_errors => true)
|
|
82
82
|
add_step_with_context(Procedures::Installer::Upgrade)
|
|
83
83
|
add_step(Procedures::Packages::LockingStatus)
|
|
84
84
|
end
|
|
@@ -86,9 +86,9 @@ module ForemanMaintain::Scenarios
|
|
|
86
86
|
|
|
87
87
|
def set_context_mapping
|
|
88
88
|
context.map(:packages,
|
|
89
|
-
|
|
89
|
+
Procedures::Packages::Install => :packages)
|
|
90
90
|
context.map(:assumeyes,
|
|
91
|
-
|
|
91
|
+
Procedures::Packages::Install => :assumeyes)
|
|
92
92
|
end
|
|
93
93
|
end
|
|
94
94
|
|
|
@@ -103,7 +103,7 @@ module ForemanMaintain::Scenarios
|
|
|
103
103
|
def compose
|
|
104
104
|
if Packages.skip_installer_run?(context.get(:packages))
|
|
105
105
|
add_step_with_context(Procedures::Packages::Update,
|
|
106
|
-
|
|
106
|
+
:force => true, :warn_on_errors => true)
|
|
107
107
|
else
|
|
108
108
|
add_steps_with_context(
|
|
109
109
|
Procedures::Packages::UpdateAllConfirmation,
|
|
@@ -111,7 +111,7 @@ module ForemanMaintain::Scenarios
|
|
|
111
111
|
)
|
|
112
112
|
add_step_with_context(Procedures::Packages::UnlockVersions)
|
|
113
113
|
add_step_with_context(Procedures::Packages::Update,
|
|
114
|
-
|
|
114
|
+
:force => true, :warn_on_errors => true)
|
|
115
115
|
add_step_with_context(Procedures::Installer::Upgrade)
|
|
116
116
|
add_step(Procedures::Packages::LockingStatus)
|
|
117
117
|
end
|
|
@@ -119,10 +119,10 @@ module ForemanMaintain::Scenarios
|
|
|
119
119
|
|
|
120
120
|
def set_context_mapping
|
|
121
121
|
context.map(:packages,
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
Procedures::Packages::Update => :packages,
|
|
123
|
+
Procedures::Packages::UpdateAllConfirmation => :packages)
|
|
124
124
|
context.map(:assumeyes,
|
|
125
|
-
|
|
125
|
+
Procedures::Packages::Update => :assumeyes)
|
|
126
126
|
end
|
|
127
127
|
end
|
|
128
128
|
end
|
|
@@ -11,15 +11,15 @@ module ForemanMaintain::Scenarios
|
|
|
11
11
|
end
|
|
12
12
|
|
|
13
13
|
# rubocop:disable Metrics/MethodLength,Metrics/AbcSize
|
|
14
|
-
# rubocop:disable Metrics/CyclomaticComplexity
|
|
14
|
+
# rubocop:disable Metrics/CyclomaticComplexity
|
|
15
15
|
def compose
|
|
16
16
|
backup = ForemanMaintain::Utils::Backup.new(context.get(:backup_dir))
|
|
17
17
|
|
|
18
18
|
add_steps(find_checks(:root_user))
|
|
19
|
-
supported_version_check
|
|
20
19
|
add_steps_with_context(Checks::Restore::ValidateBackup,
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
Checks::Restore::ValidateHostname,
|
|
21
|
+
Checks::Restore::ValidateInterfaces,
|
|
22
|
+
Checks::Restore::ValidatePostgresqlDumpPermissions)
|
|
23
23
|
|
|
24
24
|
if context.get(:dry_run)
|
|
25
25
|
self.class.metadata[:run_strategy] = :fail_slow
|
|
@@ -27,12 +27,11 @@ module ForemanMaintain::Scenarios
|
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
add_steps_with_context(Procedures::Restore::Confirmation,
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
Procedures::Selinux::SetFileSecurity,
|
|
31
|
+
Procedures::Restore::Configs)
|
|
32
32
|
add_step_with_context(Procedures::Crond::Stop) if feature(:cron)
|
|
33
33
|
unless backup.incremental?
|
|
34
|
-
add_steps_with_context(Procedures::Restore::
|
|
35
|
-
Procedures::Restore::InstallerReset)
|
|
34
|
+
add_steps_with_context(Procedures::Restore::InstallerReset)
|
|
36
35
|
end
|
|
37
36
|
add_step_with_context(Procedures::Service::Stop)
|
|
38
37
|
add_steps_with_context(Procedures::Restore::ExtractFiles) if backup.tar_backups_exist?
|
|
@@ -44,25 +43,24 @@ module ForemanMaintain::Scenarios
|
|
|
44
43
|
if backup.sql_dump_files_exist? && feature(:instance).postgresql_local?
|
|
45
44
|
add_step(Procedures::Service::Stop.new(:only => ['postgresql']))
|
|
46
45
|
end
|
|
47
|
-
restore_mongo_dump(backup)
|
|
48
46
|
|
|
49
47
|
if feature(:instance).postgresql_local? && !backup.online_backup?
|
|
50
48
|
add_step_with_context(Procedures::Restore::ReindexDatabases)
|
|
51
49
|
end
|
|
52
50
|
|
|
53
|
-
add_steps_with_context(
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
add_steps_with_context(
|
|
52
|
+
Procedures::Pulpcore::Migrate,
|
|
53
|
+
Procedures::Restore::CandlepinResetMigrations
|
|
54
|
+
)
|
|
56
55
|
|
|
57
|
-
add_steps_with_context(Procedures::Restore::RegenerateQueues) if backup.online_backup?
|
|
58
56
|
add_steps_with_context(Procedures::Service::Start,
|
|
59
|
-
|
|
57
|
+
Procedures::Service::DaemonReload)
|
|
60
58
|
add_step(Procedures::Installer::Upgrade.new(:assumeyes => true))
|
|
61
59
|
add_step_with_context(Procedures::Installer::UpgradeRakeTask)
|
|
62
60
|
add_step_with_context(Procedures::Crond::Start) if feature(:cron)
|
|
63
61
|
end
|
|
64
62
|
# rubocop:enable Metrics/MethodLength,Metrics/AbcSize
|
|
65
|
-
# rubocop:enable Metrics/CyclomaticComplexity
|
|
63
|
+
# rubocop:enable Metrics/CyclomaticComplexity
|
|
66
64
|
|
|
67
65
|
def drop_dbs(backup)
|
|
68
66
|
if backup.file_map[:candlepin_dump][:present] ||
|
|
@@ -84,35 +82,21 @@ module ForemanMaintain::Scenarios
|
|
|
84
82
|
end
|
|
85
83
|
end
|
|
86
84
|
|
|
87
|
-
def restore_mongo_dump(backup)
|
|
88
|
-
if backup.file_map[:mongo_dump][:present]
|
|
89
|
-
add_steps_with_context(Procedures::Restore::MongoDump)
|
|
90
|
-
end
|
|
91
|
-
end
|
|
92
|
-
|
|
93
|
-
def supported_version_check
|
|
94
|
-
if feature(:instance).downstream && feature(:instance).downstream.less_than_version?('6.3')
|
|
95
|
-
msg = 'ERROR: Restore subcommand is supported by Satellite 6.3+. ' \
|
|
96
|
-
'Please use katello-restore instead.'
|
|
97
|
-
abort(msg)
|
|
98
|
-
end
|
|
99
|
-
end
|
|
100
|
-
|
|
101
85
|
def set_context_mapping
|
|
102
86
|
context.map(:backup_dir,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
87
|
+
Checks::Restore::ValidateBackup => :backup_dir,
|
|
88
|
+
Checks::Restore::ValidateHostname => :backup_dir,
|
|
89
|
+
Checks::Restore::ValidateInterfaces => :backup_dir,
|
|
90
|
+
Checks::Restore::ValidatePostgresqlDumpPermissions => :backup_dir,
|
|
91
|
+
Procedures::Restore::Configs => :backup_dir,
|
|
92
|
+
Procedures::Restore::DropDatabases => :backup_dir,
|
|
93
|
+
Procedures::Restore::CandlepinDump => :backup_dir,
|
|
94
|
+
Procedures::Restore::ForemanDump => :backup_dir,
|
|
95
|
+
Procedures::Restore::PulpcoreDump => :backup_dir,
|
|
96
|
+
Procedures::Restore::ExtractFiles => :backup_dir)
|
|
113
97
|
|
|
114
98
|
context.map(:incremental_backup,
|
|
115
|
-
|
|
99
|
+
Procedures::Selinux::SetFileSecurity => :incremental_backup)
|
|
116
100
|
end
|
|
117
101
|
end
|
|
118
102
|
|
|
@@ -26,18 +26,14 @@ module ForemanMaintain::Scenarios
|
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
def maintenance_repo(version)
|
|
29
|
-
|
|
30
|
-
"rhel-#{el_major_version}-server-satellite-maintenance-#{version}-rpms"
|
|
31
|
-
else
|
|
32
|
-
"satellite-maintenance-#{version}-for-rhel-#{el_major_version}-x86_64-rpms"
|
|
33
|
-
end
|
|
29
|
+
"satellite-maintenance-#{version}-for-rhel-#{el_major_version}-x86_64-rpms"
|
|
34
30
|
end
|
|
35
31
|
|
|
36
32
|
def use_rhsm?
|
|
37
33
|
return false if maintenance_repo_label
|
|
38
34
|
|
|
39
|
-
if (repo = ENV['MAINTENANCE_REPO_LABEL'])
|
|
40
|
-
return false
|
|
35
|
+
if (repo = ENV['MAINTENANCE_REPO_LABEL']) && !repo.empty?
|
|
36
|
+
return false
|
|
41
37
|
end
|
|
42
38
|
|
|
43
39
|
true
|
|
@@ -64,7 +60,7 @@ module ForemanMaintain::Scenarios
|
|
|
64
60
|
metadata do
|
|
65
61
|
label :self_upgrade_foreman_maintain
|
|
66
62
|
description "Enables the specified version's maintenance repository and,"\
|
|
67
|
-
|
|
63
|
+
"\nupdates the satellite-maintain packages"
|
|
68
64
|
manual_detection
|
|
69
65
|
end
|
|
70
66
|
|
|
@@ -76,7 +72,7 @@ module ForemanMaintain::Scenarios
|
|
|
76
72
|
"--enablerepo=#{id}"
|
|
77
73
|
end
|
|
78
74
|
add_step(Procedures::Packages::Update.new(packages: pkgs_to_update, assumeyes: true,
|
|
79
|
-
|
|
75
|
+
yum_options: yum_options))
|
|
80
76
|
end
|
|
81
77
|
end
|
|
82
78
|
|
|
@@ -94,14 +90,14 @@ module ForemanMaintain::Scenarios
|
|
|
94
90
|
|
|
95
91
|
def rollback_repositories
|
|
96
92
|
installed_release_pkg = package_manager.find_installed_package('foreman-release',
|
|
97
|
-
|
|
93
|
+
'%{VERSION}')
|
|
98
94
|
|
|
99
95
|
unless current_version.nil? && installed_release_pkg.nil?
|
|
100
96
|
current_major_version = current_version[0..2]
|
|
101
97
|
installed_foreman_release_major_version = installed_release_pkg[0..2]
|
|
102
98
|
if installed_foreman_release_major_version != current_major_version
|
|
103
99
|
add_step(Procedures::Packages::Uninstall.new(packages: %w[foreman-release katello-repos],
|
|
104
|
-
|
|
100
|
+
assumeyes: true))
|
|
105
101
|
add_step(Procedures::Repositories::Setup.new(:version => current_major_version))
|
|
106
102
|
end
|
|
107
103
|
end
|
|
@@ -14,13 +14,13 @@ module ForemanMaintain::Scenarios
|
|
|
14
14
|
|
|
15
15
|
def set_context_mapping
|
|
16
16
|
context.map(:only,
|
|
17
|
-
|
|
17
|
+
Procedures::Service::Restart => :only)
|
|
18
18
|
|
|
19
19
|
context.map(:exclude,
|
|
20
|
-
|
|
20
|
+
Procedures::Service::Restart => :exclude)
|
|
21
21
|
|
|
22
22
|
context.map(:wait_for_server_response,
|
|
23
|
-
|
|
23
|
+
Procedures::Service::Restart => :wait_for_server_response)
|
|
24
24
|
end
|
|
25
25
|
end
|
|
26
26
|
|
|
@@ -39,10 +39,10 @@ module ForemanMaintain::Scenarios
|
|
|
39
39
|
|
|
40
40
|
def set_context_mapping
|
|
41
41
|
context.map(:only,
|
|
42
|
-
|
|
42
|
+
Procedures::Service::Stop => :only)
|
|
43
43
|
|
|
44
44
|
context.map(:exclude,
|
|
45
|
-
|
|
45
|
+
Procedures::Service::Stop => :exclude)
|
|
46
46
|
end
|
|
47
47
|
end
|
|
48
48
|
|
|
@@ -61,10 +61,10 @@ module ForemanMaintain::Scenarios
|
|
|
61
61
|
|
|
62
62
|
def set_context_mapping
|
|
63
63
|
context.map(:only,
|
|
64
|
-
|
|
64
|
+
Procedures::Service::Start => :only)
|
|
65
65
|
|
|
66
66
|
context.map(:exclude,
|
|
67
|
-
|
|
67
|
+
Procedures::Service::Start => :exclude)
|
|
68
68
|
end
|
|
69
69
|
end
|
|
70
70
|
|
|
@@ -82,10 +82,10 @@ module ForemanMaintain::Scenarios
|
|
|
82
82
|
|
|
83
83
|
def set_context_mapping
|
|
84
84
|
context.map(:only,
|
|
85
|
-
|
|
85
|
+
Procedures::Service::List => :only)
|
|
86
86
|
|
|
87
87
|
context.map(:exclude,
|
|
88
|
-
|
|
88
|
+
Procedures::Service::List => :exclude)
|
|
89
89
|
end
|
|
90
90
|
end
|
|
91
91
|
|
|
@@ -104,10 +104,10 @@ module ForemanMaintain::Scenarios
|
|
|
104
104
|
|
|
105
105
|
def set_context_mapping
|
|
106
106
|
context.map(:only,
|
|
107
|
-
|
|
107
|
+
Procedures::Service::Enable => :only)
|
|
108
108
|
|
|
109
109
|
context.map(:exclude,
|
|
110
|
-
|
|
110
|
+
Procedures::Service::Enable => :exclude)
|
|
111
111
|
end
|
|
112
112
|
end
|
|
113
113
|
|
|
@@ -126,10 +126,10 @@ module ForemanMaintain::Scenarios
|
|
|
126
126
|
|
|
127
127
|
def set_context_mapping
|
|
128
128
|
context.map(:only,
|
|
129
|
-
|
|
129
|
+
Procedures::Service::Disable => :only)
|
|
130
130
|
|
|
131
131
|
context.map(:exclude,
|
|
132
|
-
|
|
132
|
+
Procedures::Service::Disable => :exclude)
|
|
133
133
|
end
|
|
134
134
|
end
|
|
135
135
|
|
|
@@ -147,16 +147,16 @@ module ForemanMaintain::Scenarios
|
|
|
147
147
|
|
|
148
148
|
def set_context_mapping
|
|
149
149
|
context.map(:only,
|
|
150
|
-
|
|
150
|
+
Procedures::Service::Status => :only)
|
|
151
151
|
|
|
152
152
|
context.map(:exclude,
|
|
153
|
-
|
|
153
|
+
Procedures::Service::Status => :exclude)
|
|
154
154
|
|
|
155
155
|
context.map(:brief,
|
|
156
|
-
|
|
156
|
+
Procedures::Service::Status => :brief)
|
|
157
157
|
|
|
158
158
|
context.map(:failing,
|
|
159
|
-
|
|
159
|
+
Procedures::Service::Status => :failing)
|
|
160
160
|
end
|
|
161
161
|
end
|
|
162
162
|
end
|
|
@@ -40,7 +40,6 @@ module Scenarios::Capsule_6_14
|
|
|
40
40
|
|
|
41
41
|
def compose
|
|
42
42
|
add_steps(find_procedures(:pre_migrations))
|
|
43
|
-
add_step(Procedures::Service::Stop.new)
|
|
44
43
|
end
|
|
45
44
|
end
|
|
46
45
|
|
|
@@ -58,7 +57,9 @@ module Scenarios::Capsule_6_14
|
|
|
58
57
|
add_step(Procedures::Repositories::Setup.new(:version => '6.14'))
|
|
59
58
|
modules_to_enable = ["satellite-capsule:#{el_short_name}"]
|
|
60
59
|
add_step(Procedures::Packages::EnableModules.new(:module_names => modules_to_enable))
|
|
61
|
-
add_step(Procedures::Packages::
|
|
60
|
+
add_step(Procedures::Packages::Update.new(:assumeyes => true,
|
|
61
|
+
:yum_options => ['--downloadonly']))
|
|
62
|
+
add_step(Procedures::Service::Stop.new)
|
|
62
63
|
add_step(Procedures::Packages::Update.new(:assumeyes => true))
|
|
63
64
|
add_step_with_context(Procedures::Installer::Upgrade)
|
|
64
65
|
end
|
|
@@ -40,7 +40,6 @@ module Scenarios::Capsule_6_14_z
|
|
|
40
40
|
|
|
41
41
|
def compose
|
|
42
42
|
add_steps(find_procedures(:pre_migrations))
|
|
43
|
-
add_step(Procedures::Service::Stop.new)
|
|
44
43
|
end
|
|
45
44
|
end
|
|
46
45
|
|
|
@@ -58,7 +57,9 @@ module Scenarios::Capsule_6_14_z
|
|
|
58
57
|
add_step(Procedures::Repositories::Setup.new(:version => '6.14'))
|
|
59
58
|
modules_to_enable = ["satellite-capsule:#{el_short_name}"]
|
|
60
59
|
add_step(Procedures::Packages::EnableModules.new(:module_names => modules_to_enable))
|
|
61
|
-
add_step(Procedures::Packages::
|
|
60
|
+
add_step(Procedures::Packages::Update.new(:assumeyes => true,
|
|
61
|
+
:yum_options => ['--downloadonly']))
|
|
62
|
+
add_step(Procedures::Service::Stop.new)
|
|
62
63
|
add_step(Procedures::Packages::Update.new(:assumeyes => true))
|
|
63
64
|
add_step_with_context(Procedures::Installer::Upgrade)
|
|
64
65
|
end
|
|
@@ -54,6 +54,9 @@ module Scenarios::Katello_Nightly
|
|
|
54
54
|
add_step(Procedures::Repositories::Setup.new(:version => 'nightly'))
|
|
55
55
|
modules_to_enable = ["katello:#{el_short_name}", "pulpcore:#{el_short_name}"]
|
|
56
56
|
add_step(Procedures::Packages::EnableModules.new(:module_names => modules_to_enable))
|
|
57
|
+
add_step(Procedures::Packages::Update.new(:assumeyes => true,
|
|
58
|
+
:yum_options => ['--downloadonly']))
|
|
59
|
+
add_step(Procedures::Service::Stop.new)
|
|
57
60
|
add_step(Procedures::Packages::Update.new(:assumeyes => true))
|
|
58
61
|
add_step_with_context(Procedures::Installer::Upgrade)
|
|
59
62
|
end
|
|
@@ -40,7 +40,6 @@ module Scenarios::Satellite_6_14
|
|
|
40
40
|
|
|
41
41
|
def compose
|
|
42
42
|
add_steps(find_procedures(:pre_migrations))
|
|
43
|
-
add_step(Procedures::Service::Stop.new)
|
|
44
43
|
end
|
|
45
44
|
end
|
|
46
45
|
|
|
@@ -59,7 +58,9 @@ module Scenarios::Satellite_6_14
|
|
|
59
58
|
add_step(Procedures::Repositories::Setup.new(:version => '6.14'))
|
|
60
59
|
modules_to_enable = ["satellite:#{el_short_name}"]
|
|
61
60
|
add_step(Procedures::Packages::EnableModules.new(:module_names => modules_to_enable))
|
|
62
|
-
add_step(Procedures::Packages::
|
|
61
|
+
add_step(Procedures::Packages::Update.new(:assumeyes => true,
|
|
62
|
+
:yum_options => ['--downloadonly']))
|
|
63
|
+
add_step(Procedures::Service::Stop.new)
|
|
63
64
|
add_step(Procedures::Packages::Update.new(:assumeyes => true))
|
|
64
65
|
add_step_with_context(Procedures::Installer::Upgrade)
|
|
65
66
|
add_step(Procedures::Installer::UpgradeRakeTask)
|
|
@@ -40,7 +40,6 @@ module Scenarios::Satellite_6_14_z
|
|
|
40
40
|
|
|
41
41
|
def compose
|
|
42
42
|
add_steps(find_procedures(:pre_migrations))
|
|
43
|
-
add_step(Procedures::Service::Stop.new)
|
|
44
43
|
end
|
|
45
44
|
end
|
|
46
45
|
|
|
@@ -58,7 +57,9 @@ module Scenarios::Satellite_6_14_z
|
|
|
58
57
|
add_step(Procedures::Repositories::Setup.new(:version => '6.14'))
|
|
59
58
|
modules_to_enable = ["satellite:#{el_short_name}"]
|
|
60
59
|
add_step(Procedures::Packages::EnableModules.new(:module_names => modules_to_enable))
|
|
61
|
-
add_step(Procedures::Packages::
|
|
60
|
+
add_step(Procedures::Packages::Update.new(:assumeyes => true,
|
|
61
|
+
:yum_options => ['--downloadonly']))
|
|
62
|
+
add_step(Procedures::Service::Stop.new)
|
|
62
63
|
add_step(Procedures::Packages::Update.new(:assumeyes => true))
|
|
63
64
|
add_step_with_context(Procedures::Installer::Upgrade)
|
|
64
65
|
add_step(Procedures::Installer::UpgradeRakeTask)
|
|
@@ -4,14 +4,12 @@ from dnfpluginscore import _, logger
|
|
|
4
4
|
|
|
5
5
|
import configparser
|
|
6
6
|
|
|
7
|
+
PROTECT_COMMANDS = ('install', 'downgrade', 'reinstall', 'distro-sync', 'swap', 'upgrade', 'upgrade-minimal')
|
|
8
|
+
|
|
7
9
|
class ForemanProtector(dnf.Plugin):
|
|
8
10
|
name = 'foreman-protector'
|
|
9
11
|
config_name = 'foreman-protector'
|
|
10
12
|
|
|
11
|
-
def __init__(self,base,cli):
|
|
12
|
-
self.base = base
|
|
13
|
-
self.cli = cli
|
|
14
|
-
|
|
15
13
|
def _get_whitelist_file_url(self):
|
|
16
14
|
try:
|
|
17
15
|
parser = self.read_config(self.base.conf)
|
|
@@ -53,6 +51,8 @@ class ForemanProtector(dnf.Plugin):
|
|
|
53
51
|
return final_query
|
|
54
52
|
|
|
55
53
|
def sack(self):
|
|
54
|
+
if self.cli is not None and self.cli.command._basecmd not in PROTECT_COMMANDS:
|
|
55
|
+
return
|
|
56
56
|
whitelist_and_obsoletes = self._add_obsoletes()
|
|
57
57
|
all_available_packages = self.base.sack.query().available()
|
|
58
58
|
excluded_pkgs_query = all_available_packages.difference(whitelist_and_obsoletes)
|
|
@@ -17,12 +17,6 @@ boost-random
|
|
|
17
17
|
boost-iostreams
|
|
18
18
|
boost-thread
|
|
19
19
|
yum-utils
|
|
20
|
-
# el7 psql client dependencies
|
|
21
|
-
rh-postgresql12-postgresql
|
|
22
|
-
rh-postgresql12-postgresql-libs
|
|
23
|
-
rh-postgresql12-postgresql-syspaths
|
|
24
|
-
rh-postgresql12-runtime
|
|
25
|
-
scl-utils
|
|
26
20
|
# el8 psql client dependencies
|
|
27
21
|
postgresql
|
|
28
22
|
libpq
|