name: ['exim4', 'spamassassin', 'spamc']
state: latest
update_cache: yes
+
+- name: Configure /etc/default/spamassassin
+ become: true
+ replace:
+ path: /etc/default/spamassassin
+ regexp: '^OPTIONS="--create-prefs --max-children 5 --helper-home-dir"$'
+ replace: 'OPTIONS="--create-prefs --max-children 5 --helper-home-dir --socketpath=/tmp/spamassassin.sock"'
+ notify: Restart spamassassin
+
+handlers:
+ - name: Restart spamassassin
+ become: true
+ service:
+ name: spamassassin
+ state: reloaded