Remove the local whitelist file when it's empty.

This commit is contained in:
Andrea Dell'Amico 2020-12-13 17:35:49 +01:00
parent b6a5034354
commit 6bc0bc5b28
1 changed files with 7 additions and 0 deletions

View File

@ -43,6 +43,13 @@
- name: Install the local whitelist file
template: src=local_whitelist.ign2.j2 dest={{ clamav_signatures_db_dir }}/{{ clamav_signatures_whitelist_file }} owner=clamscan group=clamscan mode='0444'
notify: Restart clamd
when: clamav_signatures_whitelist != []
tags: [ 'clamav', 'clamav_clamd', 'clamav_config', 'clamav_signatures', 'clamav_whitelist' ]
- name: Remove the local whitelist file if it's empty
file: dest={{ clamav_signatures_db_dir }}/{{ clamav_signatures_whitelist_file }} state=absent
notify: Restart clamd
when: clamav_signatures_whitelist == []
tags: [ 'clamav', 'clamav_clamd', 'clamav_config', 'clamav_signatures', 'clamav_whitelist' ]
- name: Install a cron job that wipes the wrong signature files, just in case they reappear after an update