Skip to content

Commit

Permalink
Copy backup to Admin Workstation before manual noble migration
Browse files Browse the repository at this point in the history
If the admin has manually initiated a backup, let's copy a backup to the
Admin Workstation so it's easier to use. The backup is automatically
deleted at the end of a successful playbook run.

Especially for instances using SSH-over-Tor, this step may take a while,
but if something does go wrong, it'll be nice.

A backup is still taken on the server that stays on the server, there's
no adverse effect except for a slight delay in waiting for the
extraneous backup.
  • Loading branch information
legoktm committed Feb 14, 2025
1 parent 0c6b877 commit 528e087
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions install_files/ansible-base/roles/noble-migration/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@
- name: Perform migration
when: not already_finished
block:
- debug:
msg: "Taking a backup before the upgrade begins"

- name: Backup
include_role: backup
when: ossec_is_client

- debug:
msg: "Backup finished; starting the upgrade"

- name: Instruct upgrade to begin
ansible.builtin.copy:
# It's okay to enable both app and mon here to simplify the logic,
Expand Down Expand Up @@ -90,3 +100,11 @@
search_regex: '"finished":"Done"'
sleep: 5
timeout: 300

# Delete the backup file
- name: Delete backup
when: ossec_is_client
delegate_to: localhost
file:
path: "./{{ backup_filename }}"
state: absent

0 comments on commit 528e087

Please sign in to comment.