diff --git a/definitions/procedures/backup/snapshot/snapshot_deprecation_message.rb b/definitions/procedures/backup/snapshot/snapshot_deprecation_message.rb new file mode 100644 index 000000000..cbfebe6c5 --- /dev/null +++ b/definitions/procedures/backup/snapshot/snapshot_deprecation_message.rb @@ -0,0 +1,14 @@ +module Procedures::Backup + module Snapshot + class SnapshotDeprecationMessage < ForemanMaintain::Check + metadata do + description 'Snapshot backups are deprecated' + tags :backup + end + + def run + set_warn('Snapshot backups are deprecated and will be removed in a future version.') + end + end + end +end diff --git a/definitions/scenarios/backup.rb b/definitions/scenarios/backup.rb index 4fc891462..a5c417aff 100644 --- a/definitions/scenarios/backup.rb +++ b/definitions/scenarios/backup.rb @@ -21,6 +21,7 @@ class Backup < ForemanMaintain::Scenario def compose check_valid_startegy + snapshot_deprecation_warning safety_confirmation accessibility_confirmation prepare_directory @@ -110,6 +111,12 @@ def logical_volume_confirmation end end + def snapshot_deprecation_warning + if strategy == :snapshot + add_step_with_context(Procedures::Backup::Snapshot::SnapshotDeprecationMessage) + end + end + def accessibility_confirmation if [:offline, :snapshot].include?(strategy) add_step_with_context(Procedures::Backup::AccessibilityConfirmation) diff --git a/lib/foreman_maintain/cli/backup_command.rb b/lib/foreman_maintain/cli/backup_command.rb index 70214bdbe..8bc7e1e84 100644 --- a/lib/foreman_maintain/cli/backup_command.rb +++ b/lib/foreman_maintain/cli/backup_command.rb @@ -155,7 +155,7 @@ def execute class BackupCommand < Base subcommand 'online', 'Keep services online during backup', OnlineBackupCommand subcommand 'offline', 'Shut down services to preserve consistent backup', OfflineBackupCommand - subcommand 'snapshot', 'Use snapshots of the databases to create backup', SnapshotBackupCommand + subcommand 'snapshot', 'Use snapshots of the databases to create backup (DEPRECATED)', SnapshotBackupCommand end # rubocop:enable Metrics/LineLength end