mirror of
https://github.com/borgbase/ansible-role-borgbackup.git
synced 2024-11-19 19:07:42 +01:00
31 lines
1.1 KiB
YAML
31 lines
1.1 KiB
YAML
---
|
|
- name: Install borgbackup
|
|
block:
|
|
- name: Ensure legacy hooks aren't used
|
|
ansible.builtin.assert:
|
|
that:
|
|
- borgmatic_failure_command is undefined
|
|
- borgmatic_before_backup_command is undefined
|
|
- borgmatic_after_backup_command is undefined
|
|
msg: Please use the new borgmatic_hooks variable instead of individual before/after/failure hooks.
|
|
|
|
- name: Include OS-specific variables
|
|
include_vars: "{{ item }}"
|
|
with_first_found:
|
|
- "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml"
|
|
- "{{ ansible_os_family }}-{{ ansible_distribution_major_version }}.yml"
|
|
- "{{ ansible_distribution }}.yml"
|
|
- "{{ ansible_os_family }}.yml"
|
|
- "{{ ansible_lsb.id }}.yml"
|
|
|
|
- name: Install general dependencies (openssh)
|
|
when: borg_install_method != "docker"
|
|
ansible.builtin.package:
|
|
name: "{{ borg_dep_packages }}"
|
|
state: present
|
|
|
|
- name: Install Borg and Borgmatic
|
|
ansible.builtin.include_tasks:
|
|
file: noauto_install_{{ borg_install_method }}.yml
|
|
...
|