clamav: Initial version of role

This commit is contained in:
Timo Makinen 2020-09-24 18:37:40 +00:00
parent 9fb67e5a8f
commit 8cea9f7e5f
3 changed files with 45 additions and 0 deletions

View file

@ -0,0 +1,6 @@
---
- name: restart clamd
service:
name: clamd@scan
state: restarted

View file

@ -0,0 +1,4 @@
---
dependencies:
- {role: epel-repo}

View file

@ -0,0 +1,35 @@
---
- name: install packages
package:
name: "{{ item }}"
state: installed
with_items:
- clamav
- clamav-update
- clamd
- name: enable clamd local socket
lineinfile:
path: /etc/clamd.d/scan.conf
regexp: "^#LocalSocket .*"
line: "LocalSocket /run/clamd.scan/clamd.sock"
notify: restart clamd
- name: link clamd service
file:
dest: /etc/systemd/system/clamd@scan.service
src: /lib/systemd/system/clamd@.service
state: link
owner: root
group: "{{ ansible_wheel }}"
follow: false
- name: enable services
service:
name: "{{ item }}"
enabled: true
state: started
with_items:
- clamav-freshclam
- clamd@scan