Jérémy Lecour
ee21973371
All checks were successful
Ansible Lint |Total|New|Outstanding|Fixed|Trend
|:-:|:-:|:-:|:-:|:-:
|2777|524|2253|2462|:+1:
Reference build: <a href="https://jenkins.evolix.org/job/gitea/job/ansible-roles/job/unstable/223//ansiblelint">Evolix » ansible-roles » unstable #223</a>
gitea/ansible-roles/pipeline/head This commit looks good
Fully Qualified Collection Name
102 lines
2.2 KiB
YAML
102 lines
2.2 KiB
YAML
---
|
|
- name: install SpamAssasin
|
|
ansible.builtin.apt:
|
|
name:
|
|
- spamassassin
|
|
state: present
|
|
tags:
|
|
- spamassassin
|
|
|
|
- name: configure SpamAssasin
|
|
ansible.builtin.copy:
|
|
src: spamassassin.cf
|
|
dest: /etc/spamassassin/local_evolix.cf
|
|
mode: "0644"
|
|
notify: restart spamassassin
|
|
tags:
|
|
- spamassassin
|
|
|
|
- name: enable SpamAssasin
|
|
ansible.builtin.replace:
|
|
dest: /etc/default/spamassassin
|
|
regexp: 'ENABLED=0'
|
|
replace: 'ENABLED=1'
|
|
notify: restart spamassassin
|
|
tags:
|
|
- spamassassin
|
|
|
|
- name: add amavis user to debian-spamd group
|
|
ansible.builtin.user:
|
|
name: amavis
|
|
groups: debian-spamd
|
|
append: yes
|
|
tags:
|
|
- spamassassin
|
|
|
|
- name: fix right on /var/lib/spamassassin
|
|
ansible.builtin.file:
|
|
dest: /var/lib/spamassassin
|
|
state: directory
|
|
mode: "0750"
|
|
tags:
|
|
- spamassassin
|
|
|
|
- ansible.builtin.include_role:
|
|
name: evolix/remount-usr
|
|
tags:
|
|
- spamassassin
|
|
|
|
- name: Check evomaintenance config
|
|
ansible.builtin.stat:
|
|
path: /etc/evomaintenance.cf
|
|
register: _evomaintenance_config
|
|
|
|
- name: Verify sa-update dependency
|
|
ansible.builtin.assert:
|
|
that:
|
|
- _evomaintenance_config.stat.exists
|
|
msg: sa-update.sh needs /etc/evomaintenance.cf
|
|
|
|
- name: copy sa-update.sh script
|
|
ansible.builtin.copy:
|
|
src: sa-update.sh
|
|
dest: /usr/share/scripts/sa-update.sh
|
|
mode: "0750"
|
|
tags:
|
|
- spamassassin
|
|
|
|
- name: Check if cron is installed
|
|
ansible.builtin.shell:
|
|
cmd: "set -o pipefail && dpkg -l cron 2>/dev/null | grep -q -E '^(i|h)i'"
|
|
executable: /bin/bash
|
|
check_mode: no
|
|
failed_when: False
|
|
changed_when: False
|
|
register: is_cron_installed
|
|
|
|
- name: enable sa-update.sh cron
|
|
ansible.builtin.lineinfile:
|
|
dest: /etc/cron.d/sa-update
|
|
line: "42 6 5 1,4,7,10 * root /usr/share/scripts/sa-update.sh"
|
|
create: yes
|
|
state: present
|
|
mode: "0640"
|
|
when: is_cron_installed.rc == 0
|
|
tags:
|
|
- spamassassin
|
|
|
|
- name: update SpamAssasin's rules
|
|
ansible.builtin.command:
|
|
cmd: "/usr/share/scripts/sa-update.sh"
|
|
changed_when: False
|
|
tags:
|
|
- spamassassin
|
|
|
|
- name: ensure SpamAssasin is started and enabled
|
|
ansible.builtin.systemd:
|
|
name: spamassassin
|
|
state: started
|
|
enabled: True
|
|
tags:
|
|
- spamassassin
|