Merge pull request 'Cleanup borgmatic related roles' (#47) from backups into master

Reviewed-on: Aurore/ansible#47
This commit is contained in:
jeltz 2021-03-18 22:19:39 +01:00
commit 789c11c3e3
4 changed files with 17 additions and 28 deletions

View file

@ -103,10 +103,12 @@ borg_keep_daily: 7
borg_keep_weekly: 4
borg_keep_monthly: 12
borg_backup_directories:
- "/etc/"
- "/var/"
- /etc
- /var
borg_backup_exclude:
- "/var/log/"
- /var/log
- /var/lib/docker
- /var/lib/lxcfs
borg_encryption_passphrase: "{{ vault_borg_encryption_passphrase }}"
borg_server_host: 10.128.0.4

View file

@ -12,19 +12,8 @@
- src: apt/preferences.j2
dest: /etc/apt/preferences.d/borgmatic-bullseye
when:
- ansible_distribution == "Debian"
- ansible_distribution_major_version | int <= 10
- name: Don't pin borgmatic if we are on bullseye
file:
path: "/etc/apt/{{ item }}"
state: absent
loop:
- sources.list.d/bullseye.list
- preferences.d/borgmatic-bullseye
when:
- ansible_distribution == "Debian"
- ansible_distribution_release == "bullseye"
- "ansible_distribution == 'Debian'"
- "ansible_distribution_major_version in ('stretch', 'buster')"
- name: Install borgmatic
apt:
@ -119,12 +108,6 @@
state: started
enabled: true
- name: Start and enable borgmatic service
systemd:
name: borgmatic.service
state: started
enabled: true
- include_role:
name: update_motd
vars:

View file

@ -19,11 +19,14 @@ IOSchedulingPriority=7
IOWeight=100
Restart=no
# Prevent rate limiting of borgmatic log events. If you are using an older version of systemd that
# doesn't support this (pre-240 or so), you may have to remove this option.
# Prevent rate limiting of borgmatic log events. If you are using an older
# version of systemd that doesn't support this (pre-240 or so), you may have
# to remove this option.
LogRateLimitIntervalSec=0
# Delay start to prevent backups running during boot. Note that systemd-inhibit requires dbus and
# dbus-user-session to be installed.
# Delay start to prevent backups running during boot. Note that
# systemd-inhibit requires dbus and dbus-user-session to be installed.
# ExecStartPre=sleep 1m
ExecStart=systemd-inhibit --who="borgmatic" --why="Prevent interrupting scheduled backup" /usr/bin/borgmatic -v 1
ExecStart=systemd-inhibit --who="borgmatic" \
--why="Prevent interrupting scheduled backup" \
/usr/bin/borgmatic -v 2

View file

@ -4,7 +4,8 @@
Description=Timer for borgmatic backup
[Timer]
OnCalendar=daily
OnCalendar=hourly
RandomizedDelaySec=10m
[Install]
WantedBy=timers.target