bundles/postfix: only get certificate if actually needed
All checks were successful
bundlewrap/pipeline/head This commit looks good
All checks were successful
bundlewrap/pipeline/head This commit looks good
This commit is contained in:
parent
97a1b3ae85
commit
ad5c8cc0ab
2 changed files with 4 additions and 9 deletions
|
@ -1,5 +1,3 @@
|
||||||
${node.metadata['hostname']}
|
|
||||||
|
|
||||||
% for domain, aliases in sorted(node.metadata.get('letsencrypt/domains', {}).items()):
|
% for domain, aliases in sorted(node.metadata.get('letsencrypt/domains', {}).items()):
|
||||||
${domain} ${' '.join(sorted(aliases))}
|
${domain} ${' '.join(sorted(aliases))}
|
||||||
% endfor
|
% endfor
|
||||||
|
|
|
@ -49,7 +49,7 @@ else:
|
||||||
'letsencrypt/reload_after',
|
'letsencrypt/reload_after',
|
||||||
)
|
)
|
||||||
def letsencrypt(metadata):
|
def letsencrypt(metadata):
|
||||||
if not node.has_bundle('letsencrypt'):
|
if not node.has_bundle('letsencrypt') or not node.has_bundle('postfixadmin'):
|
||||||
raise DoNotRunAgain
|
raise DoNotRunAgain
|
||||||
|
|
||||||
result = {
|
result = {
|
||||||
|
@ -58,12 +58,9 @@ def letsencrypt(metadata):
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
myhostname = metadata.get('postfix/myhostname', None)
|
result['domains'] = {
|
||||||
|
metadata.get('postfix/myhostname', metadata.get('hostname')): set(),
|
||||||
if myhostname and myhostname != metadata.get('hostname'):
|
}
|
||||||
result['domains'] = {
|
|
||||||
myhostname: set(),
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'letsencrypt': result,
|
'letsencrypt': result,
|
||||||
|
|
Loading…
Reference in a new issue