1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
--- # handlers file for clamav - name: restart clamav service: name: "{{ item }}" state: restarted loop: "{{ clamav_services }}" - name: ensure logfiles exists file: path: "{{ item }}" state: touch owner: "{{ clamav_owner }}" group: "{{ clamav_group }}" mode: "0750" loop: - /var/log/clamd.scan - "{{ clamav_freshclam_log_dir }}/freshclam.log" - name: stop clamav service: name: "{{ item }}" state: stopped loop: "{{ clamav_services }}" - name: update virus definitions command: freshclam args: creates: /var/lib/clamav/main.cvd async: 900 poll: 0 register: updatevirusdefinitions - name: create selinux mod for clamav command: checkmodule -M -m -o /etc/my-clamd.mod /etc/my-clamd.te - name: create selinux pp for clamav command: semodule_package -o /etc/my-clamd.pp -m /etc/my-clamd.mod - name: load selinux pp for clamav command: semodule -i /etc/my-clamd.pp