ansible-role-spamassassin/tasks/spamass-milter.yml

29 lines
1.2 KiB
YAML

---
- name: Install the Spamassassin milter packages
block:
- name: spamassassin milter packages, RH/CentOS
yum: pkg={{ spamassassin_rh_milter_packages }} state=present
when: ansible_distribution_file_variety == "RedHat"
tags: [ 'spamassassin', 'spamass_milter' ]
- name: Manage the spamassassin milter service
block:
- name: Install the spamassassin milter startup options
template: src=spamass-milter_sysconfig.j2 dest=/etc/sysconfig/spamass-milter owner=root group=root mode=0444
notify: Restart spamass-milter
tags: [ 'spamassassin', 'spamassassin_conf', 'spamassassin_service', 'spamass_milter', 'spamass_milter_conf' ]
- name: Ensure that the spamass-milter service is started and enabled
service: name=spamass-milter state=started enabled=yes
tags: [ 'spamassassin', 'spamassassin_conf', 'spamassassin_service', 'spamass_milter' ]
- name: Manage the spamassassin service
block:
- name: Shut down the spamassassin service when we connect to a remote service
service: name=spamassassin state=stopped enabled=no
when: not spamassassin_install | bool
tags: [ 'spamassassin', 'spamassassin_conf', 'spamassassin_service', 'spamass_milter' ]