Merge pull request 'Cleanup borgmatic related roles' (#47) from backups into master
Reviewed-on: Aurore/ansible#47
This commit is contained in:
commit
789c11c3e3
4 changed files with 17 additions and 28 deletions
|
@ -103,10 +103,12 @@ borg_keep_daily: 7
|
||||||
borg_keep_weekly: 4
|
borg_keep_weekly: 4
|
||||||
borg_keep_monthly: 12
|
borg_keep_monthly: 12
|
||||||
borg_backup_directories:
|
borg_backup_directories:
|
||||||
- "/etc/"
|
- /etc
|
||||||
- "/var/"
|
- /var
|
||||||
borg_backup_exclude:
|
borg_backup_exclude:
|
||||||
- "/var/log/"
|
- /var/log
|
||||||
|
- /var/lib/docker
|
||||||
|
- /var/lib/lxcfs
|
||||||
borg_encryption_passphrase: "{{ vault_borg_encryption_passphrase }}"
|
borg_encryption_passphrase: "{{ vault_borg_encryption_passphrase }}"
|
||||||
|
|
||||||
borg_server_host: 10.128.0.4
|
borg_server_host: 10.128.0.4
|
||||||
|
|
|
@ -12,19 +12,8 @@
|
||||||
- src: apt/preferences.j2
|
- src: apt/preferences.j2
|
||||||
dest: /etc/apt/preferences.d/borgmatic-bullseye
|
dest: /etc/apt/preferences.d/borgmatic-bullseye
|
||||||
when:
|
when:
|
||||||
- ansible_distribution == "Debian"
|
- "ansible_distribution == 'Debian'"
|
||||||
- ansible_distribution_major_version | int <= 10
|
- "ansible_distribution_major_version in ('stretch', 'buster')"
|
||||||
|
|
||||||
- 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"
|
|
||||||
|
|
||||||
- name: Install borgmatic
|
- name: Install borgmatic
|
||||||
apt:
|
apt:
|
||||||
|
@ -119,12 +108,6 @@
|
||||||
state: started
|
state: started
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
- name: Start and enable borgmatic service
|
|
||||||
systemd:
|
|
||||||
name: borgmatic.service
|
|
||||||
state: started
|
|
||||||
enabled: true
|
|
||||||
|
|
||||||
- include_role:
|
- include_role:
|
||||||
name: update_motd
|
name: update_motd
|
||||||
vars:
|
vars:
|
||||||
|
|
|
@ -19,11 +19,14 @@ IOSchedulingPriority=7
|
||||||
IOWeight=100
|
IOWeight=100
|
||||||
|
|
||||||
Restart=no
|
Restart=no
|
||||||
# Prevent rate limiting of borgmatic log events. If you are using an older version of systemd that
|
# Prevent rate limiting of borgmatic log events. If you are using an older
|
||||||
# doesn't support this (pre-240 or so), you may have to remove this option.
|
# version of systemd that doesn't support this (pre-240 or so), you may have
|
||||||
|
# to remove this option.
|
||||||
LogRateLimitIntervalSec=0
|
LogRateLimitIntervalSec=0
|
||||||
|
|
||||||
# Delay start to prevent backups running during boot. Note that systemd-inhibit requires dbus and
|
# Delay start to prevent backups running during boot. Note that
|
||||||
# dbus-user-session to be installed.
|
# systemd-inhibit requires dbus and dbus-user-session to be installed.
|
||||||
# ExecStartPre=sleep 1m
|
# 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
|
||||||
|
|
|
@ -4,7 +4,8 @@
|
||||||
Description=Timer for borgmatic backup
|
Description=Timer for borgmatic backup
|
||||||
|
|
||||||
[Timer]
|
[Timer]
|
||||||
OnCalendar=daily
|
OnCalendar=hourly
|
||||||
|
RandomizedDelaySec=10m
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=timers.target
|
WantedBy=timers.target
|
||||||
|
|
Loading…
Reference in a new issue