bundles/zfs: improvements

This commit is contained in:
Franzi 2020-10-25 16:39:35 +01:00
parent 1c5e97a10f
commit 50372572f4
Signed by: kunsi
GPG key ID: 12E3D2136B818350
3 changed files with 46 additions and 27 deletions

View file

@ -3,6 +3,9 @@ files = {}
directories = { directories = {
'/etc/cron.d': { '/etc/cron.d': {
'purge': True, 'purge': True,
'needs': {
'pkg_apt:',
},
}, },
} }

View file

@ -5,32 +5,8 @@ from bundlewrap.metadata import MetadataJSONEncoder
actions = {} actions = {}
pkg_apt = {
'zfs-zed': {
'needed_by': {
'zfs_dataset:',
'zfs_pool:',
},
},
'zfsutils-linux': {
'needed_by': {
'zfs_dataset:',
'zfs_pool:',
},
},
'parted': {
'needed_by': {
'zfs_pool:',
},
},
}
files = { files = {
'/etc/cron.d/zfsutils-linux': { '/etc/modprobe.d/zfs.conf': {
'delete': True,
'needs': ['pkg_apt:zfsutils-linux'],
},
"/etc/modprobe.d/zfs.conf": {
'source': 'zfs-modprobe.conf', 'source': 'zfs-modprobe.conf',
'content_type': 'mako', 'content_type': 'mako',
'mode': '0755', 'mode': '0755',
@ -46,7 +22,9 @@ files = {
'/etc/zfs/zed.d/zed.rc': { '/etc/zfs/zed.d/zed.rc': {
'content': 'ZED_EMAIL_ADDR="hostmaster@kunbox.net"\nZED_EMAIL_PROG="mail"\nZED_NOTIFY_INTERVAL_SECS=3600\n', 'content': 'ZED_EMAIL_ADDR="hostmaster@kunbox.net"\nZED_EMAIL_PROG="mail"\nZED_NOTIFY_INTERVAL_SECS=3600\n',
'mode': '0600', 'mode': '0600',
'triggers': ['svc_systemd:zed:restart'], 'triggers': {
'svc_systemd:zed:restart'
},
}, },
'/usr/local/sbin/zfs-auto-snapshot': { '/usr/local/sbin/zfs-auto-snapshot': {
'mode': '0755', 'mode': '0755',
@ -71,7 +49,9 @@ files = {
svc_systemd = { svc_systemd = {
'zed': { 'zed': {
'needs': ['pkg_apt:zfs-zed'], 'needs': {
'pkg_apt:zfs-zed'
},
}, },
} }

View file

@ -1,6 +1,42 @@
import re import re
defaults = { defaults = {
'apt': {
'packages': {
'linux-headers-amd64': {
'needed_by': {
'pkg_apt:zfs-zed',
'pkg_apt:zfsutils-linux',
},
},
'zfs-zed': {
'needed_by': {
'zfs_dataset:',
'zfs_pool:',
},
},
'zfsutils-linux': {
'needed_by': {
'pkg_apt:zfs-zed',
'zfs_dataset:',
'zfs_pool:',
},
},
'parted': {
'needed_by': {
'zfs_pool:',
},
},
},
'repos': {
'backports': {
'install_gpg_key': False, # default debian signing key
'items': [
'deb http://deb.debian.org/debian {os_release}-backports main',
],
},
},
},
'cron': { 'cron': {
'zfs-auto-snapshot-daily': '0 0 * * * root /usr/local/sbin/zfs-auto-snapshot daily', 'zfs-auto-snapshot-daily': '0 0 * * * root /usr/local/sbin/zfs-auto-snapshot daily',
'zfs-auto-snapshot-hourly': '0 * * * * root /usr/local/sbin/zfs-auto-snapshot hourly', 'zfs-auto-snapshot-hourly': '0 * * * * root /usr/local/sbin/zfs-auto-snapshot hourly',