Skip to content

Commit

Permalink
Install pyznap rather than zfs-auto-snap
Browse files Browse the repository at this point in the history
  • Loading branch information
mergwyn committed Dec 3, 2023
1 parent f99a994 commit 13c8554
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
class profile::platform::baseline::debian::zfs {

include profile::platform::baseline::debian::zfs::autosnapshot
include profile::platform::baseline::debian::zfs::snapshotter
include profile::platform::baseline::debian::zfs::default
# include profile::platform::baseline::debian::zfs::grub
include profile::platform::baseline::debian::zfs::kernelopts
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# @summary zfs snappshotter install and configuration
#
class profile::platform::baseline::debian::zfs::snapshotter (
String $type = 'pyznap',
$settings = null,
){

case $type {
'pyznap': {
$codedir = '/opt'
$target = "${codedir}/pyznap"
$configdir = '/etc/pyznap'
$target_ini = "${configdir}/pyznap.conf"

$venv = "${target}/venv"

$owner = lookup('defaults::media_user')
$group = lookup('defaults::media_group')
$adminemail = lookup('defaults::adminemail')

python::pip { $type:
ensure => 'present',
pkgname => $type,
pip_provider => 'pip3',
virtualenv => $venv,
owner => $owner,
group => $group,
timeout => 1800
}

file { $configdir:
ensure => directory,
owner => $owner,
group => $group,
}
$defaults = {
path => $target_ini,
require => File[ $configdir ],
'rpool' => {
'frequent' => '4',
'hourly' => '24',
'daily' => '7',
'weekly' => '4',
'monthly' => '3',
'yearly' => '0',
'snap' => 'no',
'clean' => 'yes',
},
'rpool/ROOT' => {
'snap' => 'yes',
},
'rpool/home' => {
'snap' => 'yes',
}
}
inifile::create_ini_settings($settings, $defaults)

package { 'zfs-auto-snapshot': ensure => absent }
}


'zfs-auto-snapshot': {
package { 'zfs-auto-snapshot': }
}
default: {
}
}
}

0 comments on commit 13c8554

Please sign in to comment.