bundles/rspamd: dkim key can be a string, too

This commit is contained in:
Franzi 2021-07-17 16:08:42 +02:00
parent 61062c8312
commit fc0495f13a
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -71,6 +71,8 @@ if 'dkim' in node.metadata.get('rspamd', {}):
},
}
dkim_key = repo.libs.faults.ensure_fault_or_none(node.metadata['rspamd']['dkim'])
actions = {
'rspamd_assure_dkim_key_permissions': {
'command': 'chown _rspamd:_rspamd /var/lib/rspamd/dkim/*.key',
@ -81,8 +83,8 @@ if 'dkim' in node.metadata.get('rspamd', {}):
},
},
'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"'),
'command': dkim_key.format_into('cd /var/lib/rspamd/dkim && /usr/bin/rspamadm dkim_keygen -s "{0}" -b 2048 -k "{0}.key" > "{0}.txt"'),
'unless': dkim_key.format_into('test -f "/var/lib/rspamd/dkim/{0}.key"'),
'needs': {
'directory:/var/lib/rspamd/dkim',
'pkg_apt:rspamd',