diff --git a/library/roles/clamav/defaults/main.yml b/library/roles/clamav/defaults/main.yml index c7723e43..ebd3f869 100644 --- a/library/roles/clamav/defaults/main.yml +++ b/library/roles/clamav/defaults/main.yml @@ -55,6 +55,9 @@ clamav_additional_signatures_proxy_host: '' clamav_additional_signatures_proxy_port: 3128 clamav_additional_signatures_proxy_user: '' clamav_additional_signatures_proxy_pwd: '' +clamav_additional_signatures_db_dir: '/var/lib/clamav-unofficial-sigs' +clamav_additional_signatures_dbs_to_wipe: + - 'dbs-ss/scamnailer.ndb' # Freshclam clamav_freshclam_check_frequency: 12 diff --git a/library/roles/clamav/tasks/main.yml b/library/roles/clamav/tasks/main.yml index 78c9b577..6f94e363 100644 --- a/library/roles/clamav/tasks/main.yml +++ b/library/roles/clamav/tasks/main.yml @@ -44,9 +44,17 @@ with_items: - os.conf - user.conf + + - name: Wipe some unofficial signature files that are broken. Disabling them seems not enough + copy: content="" dest={{ clamav_additional_signatures_db_dir }}/{{ item }} force=yes + with_items: '{{ clamav_additional_signatures_dbs_to_wipe }}' + notify: Restart clamd + + - name: Install a cron job that wipes the wrong signature files, just in case they reappear after an update + cron: name="Wipe some unofficial clamav signature dbs that are broken" user=root special_time=hourly job="{% for db in clamav_additional_signatures_dbs_to_wipe %}echo '' > {{ clamav_additional_signatures_db_dir }}/{{ db }}{% if not loop.last %}; {% endif %}{% endfor %}" when: clamav_unofficial_sigs_install | bool - tags: [ 'clamav', 'clamav_clamd', 'clamav_config' ] + tags: [ 'clamav', 'clamav_clamd', 'clamav_config', 'clamav_unofficial_sigs' ] - name: Configure clamav milter block: