items/zfs_pool: rewrite item to support all kinds of zfs pools
All checks were successful
kunsi/bundlewrap/pipeline/head This commit looks good

This commit is contained in:
Franzi 2021-07-17 18:09:35 +02:00
parent 9111d49bf4
commit cee2a41771
Signed by: kunsi
GPG key ID: 12E3D2136B818350
10 changed files with 134 additions and 117 deletions

View file

@ -79,16 +79,12 @@ svc_systemd = {
zfs_datasets = node.metadata.get('zfs/datasets', {})
for name, attrs in node.metadata.get('zfs/pools', {}).items():
zfs_pools[name] = attrs
zfs_pools[name] = {
'config': attrs,
}
if node.os_version[0] > 10:
actions[f'pool_{name}_enable_trim'] = {
'command': f'zpool set autotrim=on {name}',
'unless': f'zpool get autotrim -H -o value {name} | grep -q on',
'needs': [
f'zfs_pool:{name}'
]
}
zfs_pools[name]['autotrim'] = True
directories = {
"/etc/zfs-snapshot-backup-pre.d": {