ansible/roles/clamav/tasks/main.yml
Patrick Uiterwijk 936e8b261a yum accepted pkg=, package calls it name=
Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
2017-10-09 00:38:26 +02:00

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"