From 50657d5f82bb450995b3f457a62c6fc4661dba56 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Wed, 20 May 2020 02:53:59 +0200 Subject: [PATCH] clamav: remove, and not just empty, the broken signature files. --- library/roles/clamav/tasks/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/roles/clamav/tasks/main.yml b/library/roles/clamav/tasks/main.yml index 78484ae9..16de66d4 100644 --- a/library/roles/clamav/tasks/main.yml +++ b/library/roles/clamav/tasks/main.yml @@ -34,13 +34,13 @@ - name: Ensure that the clamd service is running and enabled service: name=clamd@scan state=started enabled=yes - - name: Wipe some signature files that are broken. - copy: content="" dest={{ clamav_signatures_db_dir }}/{{ item }} force=yes + - name: Remove some signature files that are broken. + file: dest={{ clamav_signatures_db_dir }}/{{ item }} state=absent with_items: '{{ clamav_signatures_dbs_to_wipe }}' tags: [ 'clamav', 'clamav_clamd', 'clamav_config', 'clamav_signatures' ] - name: Install a cron job that wipes the wrong signature files, just in case they reappear after an update - cron: name="Wipe some clamav signature dbs that are broken" user=root special_time=hourly job="{% for db in clamav_signatures_dbs_to_wipe %}echo '' > {{ clamav_signatures_db_dir }}/{{ db }}{% if not loop.last %}; {% endif %}{% endfor %}" + cron: name="Wipe some clamav signature dbs that are broken" user=root special_time=hourly job="{% for db in clamav_signatures_dbs_to_wipe %}/bin/rm -f {{ clamav_signatures_db_dir }}/{{ db }}{% if not loop.last %}; {% endif %}{% endfor %}" tags: [ 'clamav', 'clamav_clamd', 'clamav_config', 'clamav_signatures' ] when: clamav_install | bool