From 7d4a99344b2551aaf7c45309924777b41c333779 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Fri, 25 Jun 2021 20:05:35 +0200 Subject: [PATCH] bundles/zfs: enable autotrim on debian bullseye and above --- bundles/zfs/items.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/bundles/zfs/items.py b/bundles/zfs/items.py index d1789c3..2d4606e 100644 --- a/bundles/zfs/items.py +++ b/bundles/zfs/items.py @@ -82,14 +82,14 @@ zfs_pools = {} for name, attrs in node.metadata.get('zfs/pools', {}).items(): zfs_pools[name] = attrs - # Not yet supported on debian buster - #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}' - # ] - #} + 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}' + ] + } directories = { "/etc/zfs-snapshot-backup-pre.d": {