diff options
| author | Ahmed Abdelhalim <[email protected]> | 2026-07-21 22:18:54 +0200 |
|---|---|---|
| committer | Ahmed Abdelhalim <[email protected]> | 2026-07-21 22:45:48 +0200 |
| commit | f63a92f908e9e79ed2249a0fdbe7b815084ce75c (patch) | |
| tree | b34058f6321db93244b23305eef54ac2a4c912f2 /roles/backup/tasks/main.yml | |
| parent | 63e99d3e642eb8b8fdcba5cc9a083edfc55a8dfe (diff) | |
Add restore capabilities to backup role with --tags restore call
Co-Authored-By: Claude.ai
Diffstat (limited to 'roles/backup/tasks/main.yml')
| -rw-r--r-- | roles/backup/tasks/main.yml | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/roles/backup/tasks/main.yml b/roles/backup/tasks/main.yml index 3859a0b2..d51d3562 100644 --- a/roles/backup/tasks/main.yml +++ b/roles/backup/tasks/main.yml @@ -49,3 +49,24 @@ - name: "Schedule backup via cron" ansible.builtin.include_tasks: "openrc.yml" when: ansible_facts['service_mgr'] == "openrc" + +- name: "Deploy restore script" + become: true + ansible.builtin.template: + src: "restore.sh.j2" + dest: "/usr/local/bin/{{ backup_name }}-restore" + owner: "root" + group: "root" + mode: "0755" + tags: + - "never" + - "restore" + +- name: "Run restore" + become: true + ansible.builtin.command: + cmd: "/usr/local/bin/{{ backup_name }}-restore" + changed_when: true + tags: + - "never" + - "restore" |
