-
Notifications
You must be signed in to change notification settings - Fork 0
/
debian-clamav.yml
63 lines (57 loc) · 1.97 KB
/
debian-clamav.yml
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# _ __ _ _ ____ _
# | |/ /__ ___ ____ _(_|_) _ \ __ _ _ __ | |_ ___ _ _
# | ' // _` \ \ /\ / / _` | | | |_) / _` | '_ \| __/ __| | | |
# | . \ (_| |\ V V / (_| | | | __/ (_| | | | | |_\__ \ |_| |
# |_|\_\__,_| \_/\_/ \__,_|_|_|_| \__,_|_| |_|\__|___/\__,_|
# ____ _ _ _
# [ ANSIBLE ] | _ \| | __ _ _ _| |__ ___ ___ | | _____
# Please only use | |_) | |/ _` | | | | '_ \ / _ \ / _ \| |/ / __|
# playbooks if | __/| | (_| | |_| | |_) | (_) | (_) | <\__ \
# you know what |_| |_|\__,_|\__, |_.__/ \___/ \___/|_|\_\___/
# they change/do |___/
#
# .---------| My Compliance Playbooks - NTP (time sync)
# |
# | This playbook will do the following:
# | - Install NTP package to latest
# | - Copy over the ntp.conf template
# | - Will use your default gateway IP as default NTP server!
# `---------------------------------------------------------------
---
- hosts: debian
tasks:
- name: Install ClamAV package
register: updatesys
apt:
update_cache: yes
force_apt_get: yes
cache_valid_time: 3600
name:
- clamav
- clamav-daemon
- clamav-freshclam
state: latest
- name: Generate Freshclam configuration file.
template:
src: "freshclam.conf.j2"
dest: "/etc/clamav/freshclam.conf"
mode: 0644
notify:
- Restart CLAMAV
- name: Delete stale freshclam.dat file to reuse new mirror setting
file:
path: /var/lib/clamav/freshclam.dat
state: absent
notify:
- Restart CLAMAV
- name: Ensure ClamAV Freshclam is running and enabled as configured.
service:
name: "clamav-freshclam"
state: started
enabled: true
handlers:
- name: Restart CLAMAV
service:
name: "clamav-freshclam"
state: restarted
ignore_errors: true