17 lines
408 B
Python
Executable file
17 lines
408 B
Python
Executable file
#!/usr/bin/env python3
|
|
class FilterModule(object):
|
|
def filters(self):
|
|
return {
|
|
'nginx_vhosts_to_certificates': self.nginx_vhosts_to_certificates
|
|
}
|
|
|
|
def nginx_vhosts_to_certificates(self, vhosts):
|
|
certs = {}
|
|
for i in vhosts.keys():
|
|
if not vhosts[i]['letsencrypt']:
|
|
continue
|
|
certs['nginx_'+i] = {
|
|
'backend': 'letsencrypt',
|
|
'san': vhosts[i]['servername']
|
|
}
|
|
return certs
|