ansible-role-server/tasks/borgbackup-Debian-stretch.yml
Jannik Beyerstedt a0ac0a67a7 [TIDY] move when statements, fix whitespace
Having the when condition of a task at the top instead of bottom is
easiert to read. Also some spaces were another whitespace character on
accident.
2022-02-13 20:52:02 +01:00

38 lines
1.1 KiB
YAML

---
# Server/Borgbackup: Install and Setup Borgbackup Backup Crobjob - Debian Stretch Version
# Variables (must be set!):
# - borgbackup_passphrase
# - borgbackup_repo
# - borgbackup_hostname
# For Debian Stretch, use a newer package version from backports
- name: borgbackup - Add debian repo key
when:
- ansible_distribution_release == 'stretch'
become: yes
ansible.builtin.apt_key:
keyserver: pgpkeys.mit.edu
id: 8B48AD6246925553
state: present
- name: borgbackup - Add stretch-backports
when:
- ansible_distribution_release == 'stretch'
become: yes
ansible.builtin.apt_repository:
repo: deb http://ftp.debian.org/debian stretch-backports main
state: present
- name: borgbackup - Install borgbackup from stretch-backports
when:
- borgbackup_passphrase is defined
- borgbackup_repo is defined
- borgbackup_hostname is defined
- ansible_distribution_release == 'stretch'
become: yes
ansible.builtin.apt:
name: borgbackup
state: latest
default_release: stretch-backports
update_cache: yes
cache_valid_time: 3600