2021-04-02 16:57:13 +00:00
|
|
|
repo.libs.tools.require_bundle(node, 'nginx', 'letsencrypt bundle needs nginx for http challenge')
|
2020-06-01 08:26:37 +00:00
|
|
|
|
|
|
|
pkg_apt = {
|
|
|
|
'dehydrated': {},
|
|
|
|
}
|
|
|
|
|
|
|
|
actions = {
|
|
|
|
'letsencrypt_update_certificates': {
|
2020-07-19 10:10:19 +00:00
|
|
|
'command': 'dehydrated --cron --accept-terms --challenge http-01',
|
2020-06-01 08:26:37 +00:00
|
|
|
'triggered': True,
|
|
|
|
'needs': {
|
2020-07-26 16:48:37 +00:00
|
|
|
'svc_systemd:nginx',
|
|
|
|
},
|
2020-06-01 08:26:37 +00:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2021-02-20 12:52:20 +00:00
|
|
|
for domain, _ in node.metadata.get('letsencrypt/domains').items():
|
|
|
|
actions['letsencrypt_ensure-some-certificate_{}'.format(domain)] = {
|
|
|
|
'command': '/etc/dehydrated/letsencrypt-ensure-some-certificate {}'.format(domain),
|
|
|
|
'unless': '/etc/dehydrated/letsencrypt-ensure-some-certificate {} true'.format(domain),
|
|
|
|
'needs': {
|
|
|
|
'file:/etc/dehydrated/letsencrypt-ensure-some-certificate',
|
|
|
|
},
|
|
|
|
'needed_by': {
|
|
|
|
'svc_systemd:nginx',
|
|
|
|
},
|
2021-02-20 14:48:17 +00:00
|
|
|
'triggers': {
|
|
|
|
'action:letsencrypt_update_certificates',
|
|
|
|
},
|
2021-02-20 12:52:20 +00:00
|
|
|
}
|
|
|
|
|
2020-06-01 08:26:37 +00:00
|
|
|
files = {
|
|
|
|
'/etc/dehydrated/domains.txt': {
|
|
|
|
'content_type': 'mako',
|
|
|
|
'triggers': {
|
|
|
|
'action:letsencrypt_update_certificates',
|
|
|
|
},
|
|
|
|
},
|
2020-07-26 16:48:37 +00:00
|
|
|
'/etc/dehydrated/config': {
|
|
|
|
'triggers': {
|
|
|
|
'action:letsencrypt_update_certificates',
|
|
|
|
},
|
|
|
|
},
|
2020-06-01 10:29:16 +00:00
|
|
|
'/etc/dehydrated/hook.sh': {
|
|
|
|
'content_type': 'mako',
|
|
|
|
'mode': '0755',
|
|
|
|
},
|
2021-02-20 12:52:20 +00:00
|
|
|
'/etc/dehydrated/letsencrypt-ensure-some-certificate': {
|
|
|
|
'mode': '0755',
|
|
|
|
},
|
2020-06-01 08:26:37 +00:00
|
|
|
}
|