diff --git a/bundles/rspamd/items.py b/bundles/rspamd/items.py index b44d8b1..022ae46 100644 --- a/bundles/rspamd/items.py +++ b/bundles/rspamd/items.py @@ -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,16 +69,22 @@ if 'dkim' in node.metadata.get('rspamd', {}): }, } - actions['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', + 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', + }, }, - 'needed_by': { - 'action:rspamd_assure_dkim_key_permissions', - }, - } + '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', + 'pkg_apt:rspamd', + }, + } if 'password' in node.metadata.get('rspamd', {}): files['/etc/rspamd/local.d/worker-controller.inc'] = {