bundlewrap/bundles/postfix/metadata.py

30 lines
535 B
Python
Raw Normal View History

2020-11-07 21:31:18 +00:00
defaults = {
'apt': {
'packages': {
'postfix': {},
},
},
}
@metadata_reactor
def letsencrypt(metadata):
if not node.has_bundle('letsencrypt'):
raise DoNotRunAgain
result = {
'reload_after': {
'postfix',
},
}
myhostname = metadata.get('postfix/myhostname', None)
if myhostname and myhostname != metadata.get('hostname'):
result['domains'] = {
myhostname: {},
}
return {
'letsencrypt': result,
}