bundles/cron: use MAILTO=, rework metadata syntax
This commit is contained in:
parent
533f8075ca
commit
0d865c93d4
22 changed files with 113 additions and 65 deletions
|
@ -35,10 +35,12 @@ defaults = {
|
|||
},
|
||||
},
|
||||
'cron': {
|
||||
'zfs-auto-snapshot-daily': '0 0 * * * root /usr/local/sbin/zfs-auto-snapshot daily',
|
||||
'zfs-auto-snapshot-hourly': '0 * * * * root /usr/local/sbin/zfs-auto-snapshot hourly',
|
||||
'zfs-auto-snapshot-monthly': '0 0 1 * * root /usr/local/sbin/zfs-auto-snapshot monthly',
|
||||
'zfs-auto-snapshot-weekly': '0 0 * * 7 root /usr/local/sbin/zfs-auto-snapshot weekly',
|
||||
'jobs': {
|
||||
'zfs-auto-snapshot-daily': '0 0 * * * root /usr/local/sbin/zfs-auto-snapshot daily',
|
||||
'zfs-auto-snapshot-hourly': '0 * * * * root /usr/local/sbin/zfs-auto-snapshot hourly',
|
||||
'zfs-auto-snapshot-monthly': '0 0 1 * * root /usr/local/sbin/zfs-auto-snapshot monthly',
|
||||
'zfs-auto-snapshot-weekly': '0 0 * * 7 root /usr/local/sbin/zfs-auto-snapshot weekly',
|
||||
},
|
||||
},
|
||||
'icinga2_api': {
|
||||
'zfs': {
|
||||
|
@ -103,13 +105,15 @@ if node.has_bundle('telegraf'):
|
|||
|
||||
|
||||
@metadata_reactor.provides(
|
||||
'cron/zfs-scrub',
|
||||
'cron/jobs/zfs-scrub',
|
||||
)
|
||||
def zfs_scrub_cronjob(metadata):
|
||||
when = metadata.get('zfs/scrub/cron', '{} 0 * * sun'.format((node.magic_number % 60)))
|
||||
return {
|
||||
'cron': {
|
||||
'zfs-scrub': '{} root /usr/lib/zfs-linux/scrub'.format(when),
|
||||
'jobs': {
|
||||
'zfs-scrub': '{} root /usr/lib/zfs-linux/scrub'.format(when),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue