diff --git a/roles/mail_server/tasks/main.yml b/roles/mail_server/tasks/main.yml index 035da548c4eb2b85397b8d0b846a8a05b2bb99d2..3d01ef702fd067a5a530ef264146e365bd2ec95f 100644 --- a/roles/mail_server/tasks/main.yml +++ b/roles/mail_server/tasks/main.yml @@ -273,7 +273,9 @@ - name: Wait for ClamAV database to be available (up to 10 minutes) when: not item.stat.exists with_items: "{{ clamav_db_files.results }}" - wait_for: path="{{ item.item | replace('.cld', '.cvd') }}" timeout=600 + wait_for: + path: "{{ item.item | replace('.cld', '.cvd') }}" + timeout: 600 - name: Enable ClamAV daemon and milter services service: @@ -283,6 +285,12 @@ - clamav-daemon - clamav-milter +# It may take ClamAV a while to read all the necessary database files etc. +- name: Wait for ClamAV to become available (up to 5 minutes) + wait_for: + path: "/var/run/clamav/clamd.ctl" + timeout: 300 + - name: Enable Postfix service service: name: postfix