bundles/zfs: run scrub for each pool separately
This commit is contained in:
parent
4823653214
commit
5640556ad9
1 changed files with 17 additions and 4 deletions
|
@ -84,10 +84,6 @@ defaults = {
|
||||||
'when': 'weekly',
|
'when': 'weekly',
|
||||||
'command': '/usr/local/sbin/zfs-auto-snapshot weekly',
|
'command': '/usr/local/sbin/zfs-auto-snapshot weekly',
|
||||||
},
|
},
|
||||||
'zfs-scrub': {
|
|
||||||
'when': 'Sun 02:00:00 UTC',
|
|
||||||
'command': '/usr/lib/zfs-linux/scrub',
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'zfs': {
|
'zfs': {
|
||||||
|
@ -136,6 +132,23 @@ if node.has_bundle('telegraf'):
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@metadata_reactor.provides(
|
||||||
|
'systemd-timers/timers/zfs-scrub',
|
||||||
|
)
|
||||||
|
def scrub_timer(metadata):
|
||||||
|
scrubs = [f'zpool scrub {pool}' for pool in sorted(metadata.get('zfs/pools', {}))]
|
||||||
|
return {
|
||||||
|
'systemd-timers': {
|
||||||
|
'timers': {
|
||||||
|
'zfs-scrub': {
|
||||||
|
'when': 'Sun 02:00:00 UTC',
|
||||||
|
'command': scrubs,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@metadata_reactor.provides(
|
@metadata_reactor.provides(
|
||||||
'icinga2_api/zfs/services',
|
'icinga2_api/zfs/services',
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue