bundles/rspamd: introduce, add to htz.ex42-1048908
Some checks failed
bundlewrap/pipeline/head There was a failure building this commit
Some checks failed
bundlewrap/pipeline/head There was a failure building this commit
This commit is contained in:
parent
a236444fe5
commit
15428b03be
14 changed files with 179 additions and 7 deletions
88
bundles/rspamd/items.py
Normal file
88
bundles/rspamd/items.py
Normal file
|
@ -0,0 +1,88 @@
|
|||
from os import listdir
|
||||
from os.path import join
|
||||
|
||||
directories = {
|
||||
'/etc/rspamd/local.d': {
|
||||
'purge': True,
|
||||
'needs': {
|
||||
'pkg_apt:rspamd',
|
||||
},
|
||||
'triggers': {
|
||||
'svc_systemd:rspamd:restart',
|
||||
},
|
||||
},
|
||||
'/etc/rspamd/override.d': {
|
||||
'purge': True,
|
||||
'needs': {
|
||||
'pkg_apt:rspamd',
|
||||
},
|
||||
'triggers': {
|
||||
'svc_systemd:rspamd:restart',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
svc_systemd = {
|
||||
'rspamd': {
|
||||
'needs': {
|
||||
'file:',
|
||||
'pkg_apt:rspamd',
|
||||
},
|
||||
},
|
||||
'clamav-daemon': {
|
||||
'needs': {
|
||||
'pkg_apt:clamav',
|
||||
'pkg_apt:clamav-daemon',
|
||||
},
|
||||
},
|
||||
'clamav-freshclam': {
|
||||
'needs': {
|
||||
'pkg_apt:clamav-freshclam',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
files = {
|
||||
'/etc/rspamd/local.d/ip_whitelist.map': {
|
||||
'content_type': 'mako',
|
||||
'triggers': {
|
||||
'svc_systemd:rspamd:restart',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
# TODO manage this using bundlewrap
|
||||
if node.metadata.get('rspamd', {}).get('dkim', False):
|
||||
for i in {'arc', 'dkim_signing'}:
|
||||
files[f'/etc/rspamd/local.d/{i}.conf'] = {
|
||||
'source': 'dkim.conf',
|
||||
'triggers': {
|
||||
'svc_systemd:rspamd:restart',
|
||||
},
|
||||
}
|
||||
|
||||
if 'password' in node.metadata.get('rspamd', {}):
|
||||
files['/etc/rspamd/local.d/worker-controller.inc'] = {
|
||||
'content_type': 'mako',
|
||||
'triggers': {
|
||||
'svc_systemd:rspamd:restart',
|
||||
},
|
||||
}
|
||||
|
||||
local_config_path = join(repo.path, 'bundles', 'rspamd', 'files', 'local.d')
|
||||
for f in listdir(local_config_path):
|
||||
files[f'/etc/rspamd/local.d/{f}'] = {
|
||||
'source': f'local.d/{f}',
|
||||
'triggers': {
|
||||
'svc_systemd:rspamd:restart',
|
||||
},
|
||||
}
|
||||
|
||||
override_config_path = join(repo.path, 'bundles', 'rspamd', 'files', 'override.d')
|
||||
for f in listdir(override_config_path):
|
||||
files[f'/etc/rspamd/override.d/{f}'] = {
|
||||
'source': f'override.d/{f}',
|
||||
'triggers': {
|
||||
'svc_systemd:rspamd:restart',
|
||||
},
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue