bundlewrap/bundles/dovecot/metadata.py

58 lines
1.5 KiB
Python
Raw Normal View History

2020-11-07 21:31:47 +00:00
defaults = {
'apt': {
'packages': {
'dovecot-imapd': {},
'dovecot-lmtpd': {},
'dovecot-managesieved': {},
'dovecot-pgsql': {},
'dovecot-sieve': {},
},
},
'icinga2_api': {
'dovecot': {
'services': {
'DOVECOT PROCESS': {
'command_on_monitored_host': '/usr/local/share/icinga/plugins/check_systemd_unit dovecot',
},
'IMAP CONNECT': {
'check_command': 'check_imap',
'vars.imap_port': 143,
},
'IMAPS CONNECT': {
'check_command': 'check_imap',
'vars.imap_port': 993,
'vars.imap_ssl': True,
},
},
},
},
'letsencrypt': {
'reload_after': {
'dovecot',
},
},
2020-11-07 21:31:47 +00:00
}
if node.has_bundle('postfixadmin'):
defaults['dovecot'] = {
'database': {
'dbname': 'postfixadmin',
'dbuser': 'postfixadmin',
},
}
@metadata_reactor
def import_database_settings_from_postfixadmin(metadata):
if not node.has_bundle('postfixadmin'):
raise DoNotRunAgain
return {
'dovecot': {
'admin_email': metadata.get('postfixadmin/admin_email'),
'database': {
'dbpass': metadata.get('postgresql/users/postfixadmin/password'),
},
},
}