postfix: move spam.sh script from amavis role

This commit is contained in:
Victor LABORIE 2017-10-24 15:23:52 +02:00
parent 10ff2747e2
commit 82cf150c05
4 changed files with 28 additions and 25 deletions

View File

@ -17,27 +17,3 @@
notify: restart amavis
tags:
- amavis
- name: copy spam.sh script
copy:
src: spam.sh
dest: /usr/share/scripts/spam.sh
mode: "0700"
tags:
- amavis
- name: enable spam.sh cron
lineinfile:
dest: /etc/cron.d/spam
line: "42 * * * * /usr/share/scripts/spam.sh"
create: yes
state: present
mode: "0640"
tags:
- amavis
- name: update antispam list
command: /usr/share/scripts/spam.sh
changed_when: false
tags:
- amavis

View File

@ -1,10 +1,10 @@
---
dependencies:
- { role: ldap, ldap_schema: 'cn4evolix.ldif' }
- { role: postfix, postfix_packmail: True, postfix_force_main_cf: True, postfix_slow_transport_include: True }
- { role: amavis }
- { role: spamassasin }
- { role: clamav }
- { role: postfix, postfix_packmail: True, postfix_force_main_cf: True, postfix_slow_transport_include: True }
- { role: dovecot }
- { role: apache }
- { role: php, php_apache_enable: True }

View File

@ -120,6 +120,33 @@
tags:
- postfix
- name: copy spam.sh script
copy:
src: spam.sh
dest: /usr/share/scripts/spam.sh
mode: "0700"
when: postfix_packmail == True
tags:
- postfix
- name: enable spam.sh cron
lineinfile:
dest: /etc/cron.d/spam
line: "42 * * * * /usr/share/scripts/spam.sh"
create: yes
state: present
mode: "0640"
when: postfix_packmail == True
tags:
- postfix
- name: update antispam list
command: /usr/share/scripts/spam.sh
changed_when: false
when: postfix_packmail == True
tags:
- postfix
- include: slow_transport.yml
when: postfix_slow_transport_include
tags: