bundles/zfs: fix dependencies, auto-load zfs module if not loaded

This commit is contained in:
Franzi 2020-10-31 10:11:15 +01:00
parent 8eeaabf615
commit 76fe68a3d1
Signed by: kunsi
GPG key ID: 12E3D2136B818350
2 changed files with 23 additions and 17 deletions

View file

@ -3,7 +3,24 @@ from os.path import join
from bundlewrap.metadata import MetadataJSONEncoder from bundlewrap.metadata import MetadataJSONEncoder
actions = {} actions = {
# For some reason, this module doesn't get auto-loaded on debian,
# even if installation of zfsutils-linux tries to start
# zfs-mount.service. We have no choice but to do it manually.
'modprobe_zfs': {
'command': 'modprobe zfs',
'unless': 'lsmod | grep ^zfs',
'needs': {
'pkg_apt:zfs-dkms',
},
'needed_by': {
'pkg_apt:zfs-zed',
'pkg_apt:zfsutils-linux',
'zfs_dataset:',
'zfs_pool:',
},
},
}
files = { files = {
'/etc/modprobe.d/zfs.conf': { '/etc/modprobe.d/zfs.conf': {

View file

@ -4,6 +4,11 @@ defaults = {
'apt': { 'apt': {
'packages': { 'packages': {
'linux-headers-amd64': { 'linux-headers-amd64': {
'needed_by': {
'pkg_apt:zfs-dkms',
},
},
'zfs-dkms': {
'needed_by': { 'needed_by': {
'pkg_apt:zfs-zed', 'pkg_apt:zfs-zed',
'pkg_apt:zfsutils-linux', 'pkg_apt:zfsutils-linux',
@ -61,22 +66,6 @@ defaults = {
}, },
} }
#if node.has_bundle('telegraf'):
# defaults.update({
# 'telegraf': {
# 'input_plugins': {
# 'exec': {
# 'zfs_dataset': {
# 'command': 'telegraf-zfs-dataset',
# 'interval': '120s',
# },
# },
# 'zfs': {},
# },
# },
# })
# defaults['sudo']['verbatim'].add('telegraf ALL=(ALL) NOPASSWD:/sbin/zfs list *')
if node.has_bundle('sshmon'): if node.has_bundle('sshmon'):
defaults.update({ defaults.update({
'icinga2_api': { 'icinga2_api': {