47 lines
1.1 KiB
YAML
47 lines
1.1 KiB
YAML
---
|
|
# tasklist for setting up a ClamAV scanner
|
|
#
|
|
# The following variables control the scan:
|
|
# - clamscan_mailto
|
|
# - clamscan_paths
|
|
# - clamscan_excludes (optional)
|
|
#
|
|
# The following variables control scheduling of the cron job:
|
|
# - clamscan_minute (optional)
|
|
# - clamscan_hour (optional)
|
|
# - clamscan_day (optional)
|
|
# - clamscan_month (optional)
|
|
# - clamscan_weekday (optional)
|
|
|
|
- name: install the needed packages
|
|
package: name={{item}} state=present
|
|
with_items:
|
|
- clamav
|
|
- clamav-data
|
|
- clamav-update
|
|
- cronie-anacron
|
|
|
|
- name: setup the freshclam configuration
|
|
copy: src=freshclam.conf dest=/etc/freshclam.conf
|
|
|
|
- name: enable freshclam by fixing the stupid default sysconfig
|
|
copy: src=freshclam-sysconfig dest=/etc/sysconfig/freshclam
|
|
|
|
- name: setup the freshclam cron job
|
|
copy: src=freshclam-cron dest=/etc/cron.daily/freshclam
|
|
|
|
- name: setup the periodic clam scan script
|
|
template: >
|
|
src=clamscan.sh.j2
|
|
dest=/usr/local/bin/clamscan.sh
|
|
mode=0755
|
|
|
|
- name: setup cron job for clam scan
|
|
cron: >
|
|
name="clamscan"
|
|
user=root
|
|
minute=35
|
|
hour=4
|
|
weekday=5
|
|
job="/usr/local/bin/clamscan.sh"
|
|
cron_file="ansible-clamscan"
|