2021-07-02 04:36:51 +00:00
|
|
|
if node.os == 'arch':
|
|
|
|
service_name = 'cronie'
|
|
|
|
package_name = 'pkg_pacman:cronie'
|
|
|
|
else:
|
|
|
|
service_name = 'cron'
|
|
|
|
package_name = 'pkg_apt:cron'
|
|
|
|
|
2020-11-09 17:22:41 +00:00
|
|
|
files = {
|
|
|
|
'/etc/crontab': {
|
|
|
|
'content_type': 'mako',
|
|
|
|
'context': {
|
|
|
|
'min': (node.magic_number%60),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
2020-06-01 09:54:28 +00:00
|
|
|
|
2020-08-30 09:14:10 +00:00
|
|
|
directories = {
|
|
|
|
'/etc/cron.d': {
|
|
|
|
'purge': True,
|
2020-10-25 15:39:35 +00:00
|
|
|
'needs': {
|
|
|
|
'pkg_apt:',
|
|
|
|
},
|
2020-08-30 09:14:10 +00:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2021-07-02 04:36:51 +00:00
|
|
|
svc_systemd = {
|
|
|
|
service_name: {
|
|
|
|
'needs': {
|
|
|
|
package_name,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2022-02-05 10:41:41 +00:00
|
|
|
for crontab, content in node.metadata.get('cron/jobs', {}).items():
|
2020-06-01 09:54:28 +00:00
|
|
|
files['/etc/cron.d/{}'.format(crontab)] = {
|
2020-11-09 17:22:41 +00:00
|
|
|
'source': 'cron_template',
|
|
|
|
'content_type': 'mako',
|
|
|
|
'context': {
|
|
|
|
'cron': content,
|
|
|
|
}
|
2020-06-01 09:54:28 +00:00
|
|
|
}
|