items/zfs_pool: rewrite item to support all kinds of zfs pools
All checks were successful
kunsi/bundlewrap/pipeline/head This commit looks good
All checks were successful
kunsi/bundlewrap/pipeline/head This commit looks good
This commit is contained in:
parent
9111d49bf4
commit
cee2a41771
10 changed files with 134 additions and 117 deletions
|
@ -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": {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue