diff --git a/bundles/cron/items.py b/bundles/cron/items.py index 7471153..7170ffe 100644 --- a/bundles/cron/items.py +++ b/bundles/cron/items.py @@ -3,6 +3,9 @@ files = {} directories = { '/etc/cron.d': { 'purge': True, + 'needs': { + 'pkg_apt:', + }, }, } diff --git a/bundles/zfs/items.py b/bundles/zfs/items.py index bff9ae7..7563147 100644 --- a/bundles/zfs/items.py +++ b/bundles/zfs/items.py @@ -5,32 +5,8 @@ from bundlewrap.metadata import MetadataJSONEncoder 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 = { - '/etc/cron.d/zfsutils-linux': { - 'delete': True, - 'needs': ['pkg_apt:zfsutils-linux'], - }, - "/etc/modprobe.d/zfs.conf": { + '/etc/modprobe.d/zfs.conf': { 'source': 'zfs-modprobe.conf', 'content_type': 'mako', 'mode': '0755', @@ -46,7 +22,9 @@ files = { '/etc/zfs/zed.d/zed.rc': { 'content': 'ZED_EMAIL_ADDR="hostmaster@kunbox.net"\nZED_EMAIL_PROG="mail"\nZED_NOTIFY_INTERVAL_SECS=3600\n', 'mode': '0600', - 'triggers': ['svc_systemd:zed:restart'], + 'triggers': { + 'svc_systemd:zed:restart' + }, }, '/usr/local/sbin/zfs-auto-snapshot': { 'mode': '0755', @@ -71,7 +49,9 @@ files = { svc_systemd = { 'zed': { - 'needs': ['pkg_apt:zfs-zed'], + 'needs': { + 'pkg_apt:zfs-zed' + }, }, } diff --git a/bundles/zfs/metadata.py b/bundles/zfs/metadata.py index 4f944b6..434e963 100644 --- a/bundles/zfs/metadata.py +++ b/bundles/zfs/metadata.py @@ -1,6 +1,42 @@ import re 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': { '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',