bundlewrap/bundles/letsencrypt/items.py

53 lines
1.5 KiB
Python
Raw Normal View History

repo.libs.tools.require_bundle(node, 'nginx', 'letsencrypt bundle needs nginx for http challenge')
2020-06-01 08:26:37 +00:00
directories = {
'/etc/dehydrated/conf.d': {},
'/var/lib/dehydrated/acme-challenges': {},
2020-06-01 08:26:37 +00:00
}
actions = {
'letsencrypt_update_certificates': {
'command': 'dehydrated --cron --accept-terms --challenge http-01',
2020-06-01 08:26:37 +00:00
'triggered': True,
'needs': {
'svc_systemd:nginx',
},
2020-06-01 08:26:37 +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',
},
'triggers': {
'action:letsencrypt_update_certificates',
},
}
2020-06-01 08:26:37 +00:00
files = {
'/etc/dehydrated/domains.txt': {
'content_type': 'mako',
'triggers': {
'action:letsencrypt_update_certificates',
},
},
'/etc/dehydrated/config': {
'triggers': {
'action:letsencrypt_update_certificates',
},
},
'/etc/dehydrated/hook.sh': {
'content_type': 'mako',
'mode': '0755',
},
'/etc/dehydrated/letsencrypt-ensure-some-certificate': {
'mode': '0755',
},
2020-06-01 08:26:37 +00:00
}