bundlewrap/bundles/letsencrypt/metadata.py

44 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(
'cron/jobs/letsencrypt',
)
def cron(metadata):
if node.metadata.get('letsencrypt/domains'):
return {
'cron': {
'jobs': {
'letsencrypt': '\n'.join([
'{} 4 * * * root /usr/bin/dehydrated --cron --accept-terms --challenge http-01 > /dev/null'.format((node.magic_number % 60)),
'{} 4 * * 0 root /usr/bin/dehydrated --cleanup > /dev/null'.format((node.magic_number % 60)),
]),
},
},
}
return {}