bundlewrap/bundles/postfix/items.py
Franziska Kunsmann 3ff5d8a7dd
All checks were successful
bundlewrap/pipeline/head This commit looks good
bundles/postfix: add alias database
2020-11-09 10:52:24 +01:00

46 lines
1,013 B
Python

if node.has_bundle('postfixadmin'):
assert node.has_bundle('letsencrypt')
files = {
'/etc/mailname': {
'content': node.metadata.get('postfix', {}).get('myhostname', node.metadata['hostname']),
'triggers': {
'svc_systemd:postfix:restart',
},
},
'/etc/aliases': {
'content_type': 'mako',
'triggers': {
'action:postfix_newaliases',
},
},
'/etc/postfix/master.cf': {
'content_type': 'mako',
'triggers': {
'svc_systemd:postfix:restart',
},
},
'/etc/postfix/main.cf': {
'content_type': 'mako',
'triggers': {
'svc_systemd:postfix:restart',
},
},
}
actions = {
'postfix_newaliases': {
'command': 'newaliases',
'triggered': True,
},
}
svc_systemd = {
'postfix': {
'needs': {
'file:/etc/postfix/master.cf',
'file:/etc/postfix/main.cf',
'pkg_apt:',
},
},
}