bundlewrap/bundles/cron/items.py
Franzi 67386d9efa
All checks were successful
bundlewrap/pipeline/head This commit looks good
bundles/cron: provide some environment, also manage /etc/crontab
2020-11-09 18:24:01 +01:00

27 lines
517 B
Python

files = {
'/etc/crontab': {
'content_type': 'mako',
'context': {
'min': (node.magic_number%60),
},
},
}
directories = {
'/etc/cron.d': {
'purge': True,
'needs': {
'pkg_apt:',
},
},
}
for crontab, content in node.metadata.get('cron', {}).items():
files['/etc/cron.d/{}'.format(crontab)] = {
'source': 'cron_template',
'content_type': 'mako',
'context': {
'cron': content,
}
}