bundles/cron: ensure cron is installed and running
This commit is contained in:
parent
a2501ed2cb
commit
7ac7c1a2b7
2 changed files with 27 additions and 0 deletions
|
@ -1,3 +1,10 @@
|
|||
if node.os == 'arch':
|
||||
service_name = 'cronie'
|
||||
package_name = 'pkg_pacman:cronie'
|
||||
else:
|
||||
service_name = 'cron'
|
||||
package_name = 'pkg_apt:cron'
|
||||
|
||||
files = {
|
||||
'/etc/crontab': {
|
||||
'content_type': 'mako',
|
||||
|
@ -16,6 +23,14 @@ directories = {
|
|||
},
|
||||
}
|
||||
|
||||
svc_systemd = {
|
||||
service_name: {
|
||||
'needs': {
|
||||
package_name,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for crontab, content in node.metadata.get('cron', {}).items():
|
||||
files['/etc/cron.d/{}'.format(crontab)] = {
|
||||
'source': 'cron_template',
|
||||
|
|
12
bundles/cron/metadata.py
Normal file
12
bundles/cron/metadata.py
Normal file
|
@ -0,0 +1,12 @@
|
|||
defaults = {
|
||||
'apt': {
|
||||
'packages': {
|
||||
'cron': {},
|
||||
},
|
||||
},
|
||||
'pacman': {
|
||||
'packages': {
|
||||
'cronie': {},
|
||||
},
|
||||
},
|
||||
}
|
Loading…
Reference in a new issue