Files
fedora-infra_ansible/roles/clamav/tasks/main.yml
Ryan Lerch 47c68f478d ansiblelint fixes - fqcn[action-core] - template to ansible.builtin.template
Replaces references to template: with ansible.builtin.template

Signed-off-by: Ryan Lerch <rlerch@redhat.com>
2025-01-15 11:30:29 +10:00

48 lines
1.2 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
ansible.builtin.package: name={{item}} state=present
with_items:
- clamav
- clamav-data
- clamav-update
- cronie-anacron
- name: Setup the freshclam configuration
ansible.builtin.copy: src=freshclam.conf dest=/etc/freshclam.conf
- name: Enable freshclam by fixing the stupid default sysconfig
ansible.builtin.copy: src=freshclam-sysconfig dest=/etc/sysconfig/freshclam
- name: Setup the freshclam cron job
ansible.builtin.copy: src=freshclam-cron dest=/etc/cron.daily/freshclam
- name: Setup the periodic clam scan script
ansible.builtin.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"