feat(snapper): Add manual snap script

Can be run before dangerous commands to create a quick backup of the
system before running it.
This commit is contained in:
Marty Oehme 2025-02-26 21:37:54 +01:00
parent e112bb3078
commit 8301bfb522
Signed by: Marty
GPG key ID: 4E535BC19C61886E
2 changed files with 15 additions and 0 deletions

View file

@ -0,0 +1,7 @@
#!/usr/bin/env bash
CONFIG="${SNAP_CONFIG:-root}"
echo RUNNING: snapper --config="$CONFIG" --quiet create --description="${*//sudo /}" --cleanup-algorithm="number"
"$@"

View file

@ -188,6 +188,14 @@
mode: 0640
force: true
- name: Add snap manual safety command
ansible.builtin.copy:
src: snapper-snap-script
dest: "/usr/bin/snap"
owner: root
group: root
mode: 0755
handlers:
# # Do NOT activate the snapperd service -
# # on systems without elogind I guess? Unsure