nixus.zfs-snap: ZFS snapshots before switching configuration (+cleanup) #44
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This module adds support for making a ZFS snapshot on the node that is to be deployed to, before the configuration is switched.
This is nice in cases such as Nexcloud, which will run a migration when switching and if it fails you can no longer switch back to the previous version.
There is also the option of doing cleanup of the previous snapshots, which will by default keep the last 30 snapshots.
If this is set to 0, it will delete the snapshots right after a successful switch.
If set to a negative number ie. -1, it will keep them forever, and an external tool might be run to delete them on a interval.
To allow non-root users to create snapshots
zfs allow nix-deployer snapshot rpool/safe/persistent
should be used.I do not like allowing the same user to delete snapshots, as it includes snapshots not made by nixus as well, and would rather use an external program to handle this for me.