2020-08-18 13:27:55 +00:00
|
|
|
defaults = {
|
2021-06-01 14:52:52 +00:00
|
|
|
'apt': {
|
|
|
|
'packages': {
|
2021-12-23 18:38:21 +00:00
|
|
|
'openssl': {
|
|
|
|
'needed_by': {
|
|
|
|
'action:letsencrypt_update_certificates',
|
|
|
|
},
|
|
|
|
},
|
2021-12-19 13:16:14 +00:00
|
|
|
'dehydrated': {
|
|
|
|
'needed_by': {
|
|
|
|
'action:letsencrypt_update_certificates',
|
|
|
|
},
|
|
|
|
},
|
2021-06-01 14:52:52 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
'pacman': {
|
|
|
|
'packages': {
|
2021-12-19 13:16:14 +00:00
|
|
|
'dehydrated': {
|
|
|
|
'needed_by': {
|
|
|
|
'action:letsencrypt_update_certificates',
|
|
|
|
},
|
|
|
|
},
|
2021-06-01 14:52:52 +00:00
|
|
|
},
|
|
|
|
},
|
2020-08-18 13:27:55 +00:00
|
|
|
}
|
2022-02-05 10:41:41 +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 {}
|