From b536632f32d81dceb11f2b7ebf2ec1a284498901 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Sun, 22 May 2016 17:57:38 +0200 Subject: spamassassin: list our IPSec subnet in trusted_networks. --- roles/IMAP/tasks/main.yml | 6 +++--- roles/IMAP/tasks/spam.yml | 25 ++++++++++++++++++++++--- 2 files changed, 25 insertions(+), 6 deletions(-) (limited to 'roles/IMAP/tasks') diff --git a/roles/IMAP/tasks/main.yml b/roles/IMAP/tasks/main.yml index f9b25d1..b26cb10 100644 --- a/roles/IMAP/tasks/main.yml +++ b/roles/IMAP/tasks/main.yml @@ -8,9 +8,9 @@ - mda - mail - postfix -# TODO spam filter +## TODO spam filter #- include: spam.yml -# tags +# tags: # - spam +# - amavis # - spamassassin -# diff --git a/roles/IMAP/tasks/spam.yml b/roles/IMAP/tasks/spam.yml index 06624dd..3091b85 100644 --- a/roles/IMAP/tasks/spam.yml +++ b/roles/IMAP/tasks/spam.yml @@ -25,22 +25,34 @@ - meta: flush_handlers + - name: Copy SpamAssassin's configuration copy: src=etc/{{ item }} dest=/etc/{{ item }} owner=root group=root mode=0644 with_items: - - spamassassin/local.cf - spamassassin/v310.pre - spamassassin/v320.pre + register: r1 + notify: + - Restart Amavis + +- name: Copy SpamAssassin's configuration (2) + template: src=etc/{{ item }}.j2 + dest=/etc/{{ item }} + owner=root group=root + mode=0644 + with_items: + - spamassassin/local.cf + register: r2 notify: - Restart Amavis - name: Provision /etc/default/spamassassin lineinfile: dest=/etc/default/spamassassin - regexp='^(\s*#)?\s*{{ item.var }}=' - "line={{ item.var }}={{ item.value }}" + regexp='^(\\s*#)?\\s*{{ item.var }}\\s*=' + line='{{ item.var }}={{ item.value }}' owner=root group=root mode=0644 with_items: @@ -59,5 +71,12 @@ /spamassassin.bayes_vars: SELECT,INSERT,UPDATE,DELETE /spamassassin.bayes_expire: SELECT,INSERT, DELETE" state=present + register: r3 notify: - Restart Amavis + +- name: Start Amavis + service: name=amavis state=started + when: not (r1.changed or r2.changed or r3.changed) + +- meta: flush_handlers -- cgit v1.2.3