bundlewrap/bundles/letsencrypt/metadata.py

48 lines
1.2 KiB
Python
Raw Normal View History

2020-08-18 13:27:55 +00:00
defaults = {
'apt': {
'packages': {
2021-12-23 18:38:21 +00:00
'openssl': {
'needed_by': {
'action:letsencrypt_update_certificates',
},
},
'dehydrated': {
'needed_by': {
'action:letsencrypt_update_certificates',
},
},
},
},
'pacman': {
'packages': {
'dehydrated': {
'needed_by': {
'action:letsencrypt_update_certificates',
},
},
},
},
2020-08-18 13:27:55 +00:00
}
@metadata_reactor.provides(
'systemd-timers/timers/letsencrypt',
)
def cron(metadata):
if node.metadata.get('letsencrypt/domains'):
return {
'systemd-timers': {
'timers': {
'letsencrypt': {
'command': [
'/usr/bin/dehydrated --cron --accept-terms --challenge http-01',
'/usr/bin/dehydrated --cleanup',
],
'when': '04:{}:00'.format(node.magic_number % 60),
'exclude_from_monitoring': True,
},
},
},
}
return {}