summaryrefslogtreecommitdiffstats
path: root/roles/common/tasks/clamav.yml
blob: 437387b6e86a4ca7877a34544523a97a74011b4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
- name: Install ClamAV
  apt: pkg={{ packages }}
  vars:
    packages:
    - clamav
    - clamav-daemon
    - clamav-freshclam

- name: Configure FreshClam
  template: src=etc/clamav/freshclam.conf.j2
            dest=/etc/clamav/freshclam.conf
            owner=clamav group=adm
            mode=0444
  tags: freshclam
  notify:
    - Restart freshclam

- name: Start ClamAV
  service: name={{ item }} state=started
  with_items:
    - clamav-daemon
    - clamav-freshclam

- name: Add a 'clamav' alias
  lineinfile: dest=/etc/aliases create=yes
              regexp="^clamav{{':'}} "
              line="clamav{{':'}} root"

- name: Compile the static local Postfix database
  postmap: cmd=postalias src=/etc/aliases db=lmdb
           owner=root group=root
           mode=0644