diff options
author | Guilhem Moulin <guilhem@fripost.org> | 2014-07-07 05:30:48 +0200 |
---|---|---|
committer | Guilhem Moulin <guilhem@fripost.org> | 2015-06-07 02:52:36 +0200 |
commit | 065fdc8f78639593ae73532e01dda16fbbb3a727 (patch) | |
tree | 3e754b14a4aee0704aa57d8712bd5f1c174637ff /roles/amavis | |
parent | 8fdaba4d764b9e534a0343746a3e30cf3f68852e (diff) |
Generate the DKIM key on the outgoing instance only.
Diffstat (limited to 'roles/amavis')
-rw-r--r-- | roles/amavis/tasks/main.yml | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/roles/amavis/tasks/main.yml b/roles/amavis/tasks/main.yml index 6965c07..da1f86a 100644 --- a/roles/amavis/tasks/main.yml +++ b/roles/amavis/tasks/main.yml @@ -18,45 +18,49 @@ - zoo - ripole - cabextract - unar - tnef notify: - Restart Amavis - name: Add 'clamav' to the group 'amavis' user: name=clamav groups=amavis append=yes register: r1 notify: - Restart ClamAV - Restart Amavis - name: Create directory /var/lib/dkim file: path=/var/lib/dkim state=directory owner=root group=root mode=0755 + when: "'out' in group_names" + tags: + - genkey - name: Generate a private key for DKIM signing command: genkeypair.sh dkim --privkey=/var/lib/dkim/20140703.fripost.org.key -t rsa -b 1024 register: dkim changed_when: dkim.rc == 0 failed_when: dkim.rc > 1 + when: "'out' in group_names" notify: - Restart Amavis - Publish the public key to the DNS zone tags: - genkey - name: Configure Amavis template: src=etc/amavis/conf.d/50-user.j2 dest=/etc/amavis/conf.d/50-user owner=root group=root mode=0644 register: r3 notify: - Restart Amavis - meta: flush_handlers - name: Start Amavis service: name=amavis state=started |