diff --git a/roles/mail_server/tasks/main.yml b/roles/mail_server/tasks/main.yml index beac798a7bc9ff859879362bd3a930943d2494b0..f764bb54819d98488c147af23a638d28c9a4426d 100644 --- a/roles/mail_server/tasks/main.yml +++ b/roles/mail_server/tasks/main.yml @@ -134,11 +134,19 @@ - postfix - dovecot -- name: Enable ClamAV service +- name: Enable ClamAV database update service (freshclam) + service: name=clamav-freshclam state=started + +- name: Wait for ClamAV database to be available (up to 10 minutes) + wait_for: path="{{ item }}" timeout=600 + with_items: + - "/var/lib/clamav/daily.cvd" + - "/var/lib/clamav/main.cvd" + +- name: Enable ClamAV daemon and milter services service: name="{{ item }}" state=started with_items: - clamav-daemon - - clamav-freshclam - clamav-milter - name: Enable Postfix service