2019-08-13 13:26:40 +02:00
|
|
|
---
|
2022-10-06 14:52:27 +02:00
|
|
|
- name: Add OS specific variables
|
2021-03-23 16:16:20 +01:00
|
|
|
ansible.builtin.include_vars: "{{ lookup('first_found', restic_os_variables) }}"
|
2019-08-13 13:26:40 +02:00
|
|
|
|
2022-10-06 14:52:27 +02:00
|
|
|
- name: Perform optional versionscheck
|
2021-04-29 16:16:35 +02:00
|
|
|
ansible.builtin.include_tasks: 'versioncheck.yml'
|
2022-01-07 20:13:57 +01:00
|
|
|
when: submodules_versioncheck | bool
|
2019-08-13 13:26:40 +02:00
|
|
|
|
2022-10-06 14:52:27 +02:00
|
|
|
- name: Make sure restic is available
|
2021-04-29 16:16:35 +02:00
|
|
|
ansible.builtin.include_tasks: 'preperation.yml'
|
2019-08-13 13:52:25 +02:00
|
|
|
|
2022-10-06 14:52:27 +02:00
|
|
|
- name: Make sure restic is installed
|
2021-04-29 13:48:02 +02:00
|
|
|
ansible.builtin.include_tasks: 'install.yml'
|
2019-08-13 13:52:25 +02:00
|
|
|
when: not restic_executable.stat.exists or not restic_installed.stat.exists
|
|
|
|
|
2022-10-06 14:52:27 +02:00
|
|
|
- name: Initialize restic repo(s)
|
2021-04-29 13:48:02 +02:00
|
|
|
ansible.builtin.include_tasks: 'configure.yml'
|
2019-08-13 13:26:40 +02:00
|
|
|
|
2022-10-06 14:52:27 +02:00
|
|
|
- name: Create backup script
|
2021-04-29 16:16:35 +02:00
|
|
|
ansible.builtin.include_tasks: 'backup.yml'
|
|
|
|
loop_control:
|
|
|
|
loop_var: loop_distribution
|
|
|
|
vars:
|
|
|
|
distribution: '{{ ansible_distribution }}'
|
|
|
|
distribution_version: '{{ ansible_distribution_version }}'
|
|
|
|
distribution_major_version: '{{ ansible_distribution_major_version }}'
|
|
|
|
|
2022-10-06 14:52:27 +02:00
|
|
|
- name: Schedule restic backup
|
2021-08-02 01:09:02 +02:00
|
|
|
ansible.builtin.include_tasks: 'schedule.yml'
|
2019-08-13 13:26:40 +02:00
|
|
|
loop_control:
|
|
|
|
loop_var: loop_distribution
|
|
|
|
vars:
|
|
|
|
distribution: '{{ ansible_distribution }}'
|
|
|
|
distribution_version: '{{ ansible_distribution_version }}'
|
|
|
|
distribution_major_version: '{{ ansible_distribution_major_version }}'
|