bundles/letsencrypt: use systemd-timers
This commit is contained in:
parent
944c66354b
commit
f004591e98
1 changed files with 10 additions and 7 deletions
|
@ -26,17 +26,20 @@ defaults = {
|
||||||
|
|
||||||
|
|
||||||
@metadata_reactor.provides(
|
@metadata_reactor.provides(
|
||||||
'cron/jobs/letsencrypt',
|
'systemd-timers/timers/letsencrypt',
|
||||||
)
|
)
|
||||||
def cron(metadata):
|
def cron(metadata):
|
||||||
if node.metadata.get('letsencrypt/domains'):
|
if node.metadata.get('letsencrypt/domains'):
|
||||||
return {
|
return {
|
||||||
'cron': {
|
'systemd-timers': {
|
||||||
'jobs': {
|
'timers': {
|
||||||
'letsencrypt': '\n'.join([
|
'letsencrypt': {
|
||||||
'{} 4 * * * root /usr/bin/dehydrated --cron --accept-terms --challenge http-01 > /dev/null'.format((node.magic_number % 60)),
|
'command': [
|
||||||
'{} 4 * * 0 root /usr/bin/dehydrated --cleanup > /dev/null'.format((node.magic_number % 60)),
|
'/usr/bin/dehydrated --cron --accept-terms --challenge http-01',
|
||||||
]),
|
'/usr/bin/dehydrated --cleanup',
|
||||||
|
],
|
||||||
|
'when': '04:{}:00'.format(node.magic_number % 60),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue