bundles/rspamd: fix dependencies

This commit is contained in:
Franzi 2020-12-18 06:41:05 +01:00
parent 65db8b1625
commit 63d455d242
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -30,7 +30,6 @@ directories = {
svc_systemd = {
'rspamd': {
'needs': {
'file:',
'pkg_apt:rspamd',
},
},
@ -56,14 +55,6 @@ files = {
},
}
actions = {
'rspamd_assure_dkim_key_permissions': {
'command': 'chown _rspamd:_rspamd /var/lib/rspamd/dkim/*.key',
'needs': {
'directory:/var/lib/rspamd/dkim',
},
},
}
if 'dkim' in node.metadata.get('rspamd', {}):
for i in {'arc', 'dkim_signing'}:
@ -78,14 +69,20 @@ if 'dkim' in node.metadata.get('rspamd', {}):
},
}
actions['rspamd_generate_dkim_key'] = {
actions = {
'rspamd_assure_dkim_key_permissions': {
'command': 'chown _rspamd:_rspamd /var/lib/rspamd/dkim/*.key',
'needs': {
'action:rspamd_generate_dkim_key',
'directory:/var/lib/rspamd/dkim',
},
},
'rspamd_generate_dkim_key': {
'command': node.metadata['rspamd']['dkim'].format_into('cd /var/lib/rspamd/dkim && /usr/bin/rspamadm dkim_keygen -s "{0}" -b 2048 -k "{0}.key" > "{0}.txt"'),
'unless': node.metadata['rspamd']['dkim'].format_into('test -f "/var/lib/rspamd/dkim/{0}.key"'),
'needs': {
'directory:/var/lib/rspamd/dkim',
},
'needed_by': {
'action:rspamd_assure_dkim_key_permissions',
'pkg_apt:rspamd',
},
}