bundles/dovecot: introduce
This commit is contained in:
parent
f42dda5961
commit
18b573a9c6
7 changed files with 286 additions and 0 deletions
66
bundles/dovecot/items.py
Normal file
66
bundles/dovecot/items.py
Normal file
|
@ -0,0 +1,66 @@
|
|||
# Postfix bundle creates metadata and directories which are also used
|
||||
# by this bundle
|
||||
assert node.has_bundle('postfix')
|
||||
|
||||
files = {
|
||||
'/etc/dovecot/dovecot.conf': {
|
||||
'content_type': 'mako',
|
||||
'context': {
|
||||
'admin_email': node.metadata['dovecot']['admin_email'],
|
||||
},
|
||||
'needs': {
|
||||
'pkg_apt:'
|
||||
},
|
||||
'triggers': {
|
||||
'svc_systemd:dovecot:restart',
|
||||
},
|
||||
},
|
||||
'/etc/dovecot/dovecot-sql.conf': {
|
||||
'content_type': 'mako',
|
||||
'context': node.metadata['dovecot']['database'],
|
||||
'needs': {
|
||||
'pkg_apt:'
|
||||
},
|
||||
'triggers': {
|
||||
'svc_systemd:dovecot:restart',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
actions = {
|
||||
'dovecot_generate_dhparam': {
|
||||
'command': 'openssl dhparam -out /etc/dovecot/ssl/dhparam.pem 2048',
|
||||
'unless': 'test -f /etc/dovecot/ssl/dhparam.pem',
|
||||
'cascade_skip': False,
|
||||
'needs': {
|
||||
'pkg_apt:'
|
||||
},
|
||||
'triggers': {
|
||||
'svc_systemd:dovecot:restart',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
svc_systemd = {
|
||||
'dovecot': {
|
||||
'needs': {
|
||||
'action:dovecot_generate_dhparam',
|
||||
'file:/etc/dovecot/dovecot.conf',
|
||||
'file:/etc/dovecot/dovecot-sql.conf',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
if node.has_bundle('rspamd'):
|
||||
files['/var/mail/vmail/sieve/global/learn-ham.sieve'] = {
|
||||
'owner': 'nobody',
|
||||
'group': 'nogroup',
|
||||
}
|
||||
files['/var/mail/vmail/sieve/global/learn-spam.sieve'] = {
|
||||
'owner': 'nobody',
|
||||
'group': 'nogroup',
|
||||
}
|
||||
files['/var/mail/vmail/sieve/global/spam-global.sieve'] = {
|
||||
'owner': 'nobody',
|
||||
'group': 'nogroup',
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue