1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_restic.git synced 2024-12-11 23:41:32 +01:00
ansible_role_restic/tasks/main.yml
2022-11-05 21:51:25 +01:00

35 lines
1.2 KiB
YAML

---
- name: Add OS specific variables
ansible.builtin.include_vars: "{{ lookup('first_found', restic_os_variables) }}"
- name: Perform optional versionscheck
ansible.builtin.include_tasks: 'versioncheck.yml'
when: submodules_versioncheck | bool
- name: Make sure restic is available
ansible.builtin.include_tasks: 'preparation.yml'
- name: Make sure restic is installed
ansible.builtin.include_tasks: 'install.yml'
when: not restic_executable.stat.exists or not restic_installed.stat.exists
- name: Initialize restic repo(s)
ansible.builtin.include_tasks: 'configure.yml'
- name: Create backup script
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 }}'
- name: Schedule restic backup
ansible.builtin.include_tasks: 'schedule.yml'
loop_control:
loop_var: loop_distribution
vars:
distribution: '{{ ansible_distribution }}'
distribution_version: '{{ ansible_distribution_version }}'
distribution_major_version: '{{ ansible_distribution_major_version }}'