add resnap

Users must provide their own password and restore files.
This commit is contained in:
Pig Monkey 2026-05-08 08:38:23 -07:00
parent e08a318ee3
commit 4ca00a2810
7 changed files with 55 additions and 20 deletions

3
.gitmodules vendored
View file

@ -4,3 +4,6 @@
[submodule "roles/cryptshot/files/cryptshot"]
path = roles/cryptshot/files/cryptshot
url = https://github.com/pigmonkey/cryptshot
[submodule "roles/resnap/files/resnap"]
path = roles/resnap/files/resnap
url = https://github.com/pigmonkey/resnap

View file

@ -181,17 +181,15 @@ firejail:
- ~/.vdirsyncer
- ~/library
resnap:
exclude_user_cache: True
drives:
- name: alta
uuid: a71fda0d-a2a4-4b29-a9dd-2cbaba9731f8
- name: pilchuck
uuid: b19dbe02-5447-4031-b08d-73380117bf44
cryptshot:
- name: alta
uuid: a71fda0d-a2a4-4b29-a9dd-2cbaba9731f8
keyfile: /home/pigmonkey/.keys/usb-alta.key
retain:
- level: daily
interval: 7
- level: weekly
interval: 6
- level: monthly
interval: 3
- name: bishorn
uuid: baeb40a2-b19e-4adc-8ef6-44ee720a4d1a
keyfile: /home/pigmonkey/.keys/usb-bishorn.key
@ -212,16 +210,6 @@ cryptshot:
interval: 6
- level: monthly
interval: 3
- name: pilchuck
uuid: d96a0fc3-7ea1-42f7-b0d0-42e573c478bd
keyfile: /home/pigmonkey/.keys/usb-pilchuck.key
retain:
- level: daily
interval: 7
- level: weekly
interval: 6
- level: monthly
interval: 3
journal:
max_size: 500M

View file

@ -65,6 +65,7 @@
- { role: virtualbox, tags: ["virtualbox"] }
- { role: backitup, tags: ["backitup"] }
- { role: cryptshot, tags: ["cryptshot"], when: "cryptshot is defined" }
- { role: resnap, tags: ["resnap"], when: "resnap is defined" }
- { role: borg, tags: ["borg"] }
- { role: tarsnap, tags: ["tarsnap"] }
- { role: mapping, tags: ["mapping"] }

@ -0,0 +1 @@
Subproject commit 080db83d7bc44c580fba38c18af0590eb9d1e7a0

View file

@ -0,0 +1,31 @@
---
- name: Install resnap
ansible.builtin.copy:
src: resnap/resnap
dest: /usr/local/bin/
mode: "0755"
- name: Install resnap-restore
ansible.builtin.copy:
src: resnap/resnap-restore
dest: /usr/local/bin/
mode: "0755"
- name: Create resnap config directory
ansible.builtin.file:
path: /usr/local/etc/resnap
state: directory
mode: "0755"
- name: Push resnap drives configuration
ansible.builtin.template:
src: drives.j2
dest: /usr/local/etc/resnap/drives
mode: "0644"
when: resnap.drives is defined
- name: Push resnap exclude configuration
ansible.builtin.template:
src: excludes.j2
dest: /usr/local/etc/resnap/excludes
mode: "0644"

View file

@ -0,0 +1,3 @@
{% for drive in resnap.drives %}
{{ drive.name}} {{ drive.uuid }}
{% endfor %}

View file

@ -0,0 +1,8 @@
/lost+found
/swapfile
/tmp
/var/cache
/var/lib/dhcpcd
/var/lib/docker
/var/lib/pacman/sync
{% if resnap.exclude_user_cache %}/home/{{ user.name }}/.cache{% endif %}