/
/
/
Ansible role that can run restic backups and push it to a remote storage server.
1---
2- name: Validate variables and environment
3 ansible.builtin.import_tasks: validate.yml
4 tags: [backup, validate]
5
6- name: Ensure restic is installed (Debian/Ubuntu)
7 ansible.builtin.apt:
8 name: "{{ backup_restic_pkg_name }}"
9 state: present
10 update_cache: true
11 when: backup_install_restic | bool
12 become: true
13 tags: [backup, restic]
14
15- name: Ensure restic repo exists / is initialized
16 ansible.builtin.import_tasks: restic.yml
17 tags: [backup, restic]
18
19- name: Backup each Compose project sequentially
20 ansible.builtin.include_tasks: backup_one.yml
21 loop: "{{ backup_services }}"
22 loop_control:
23 label: "{{ item.name | default(item.path) }}"
24 tags: [backup]
25
26