Added bootstrap role with the tasks, defaults and handlers necessary for the playbooks
This commit is contained in:
47
roles/bootstrap/handlers/clamav.yml
Normal file
47
roles/bootstrap/handlers/clamav.yml
Normal file
@@ -0,0 +1,47 @@
|
||||
---
|
||||
#@TODO write handlers for configuring clamav
|
||||
#@NOTE https://wiki.archlinux.org/title/ClamAV
|
||||
- name: Check if freshclam file exists
|
||||
stat:
|
||||
path: /etc/clamav/freshclam.conf
|
||||
register: freshclampath
|
||||
- name: Check if clamd file exists
|
||||
stat:
|
||||
path: /etc/clamav/clamd.conf
|
||||
register: clamdpath
|
||||
- name: Check if milter file exists
|
||||
stat:
|
||||
path: /etc/clamav/clamav-milter.conf
|
||||
register: milterpath
|
||||
- name: Create freshclam file if not exists
|
||||
file:
|
||||
path: /etc/clamav/freshclam.conf
|
||||
stat: touch
|
||||
register: freshclam_created
|
||||
- name: Create freshclam file
|
||||
become: yes
|
||||
become_method: sudo
|
||||
copy:
|
||||
src: clamav/freshclam.conf
|
||||
dest: /etc/clamav/freshclam.conf
|
||||
force: yes
|
||||
backup: yes
|
||||
when: not freshclampath.stat.exists
|
||||
- name: Create clamd file
|
||||
become: yes
|
||||
become_method: sudo
|
||||
copy:
|
||||
src: clamav/clamd.conf
|
||||
dest: /etc/clamav/clamd.conf
|
||||
force: yes
|
||||
backup: yes
|
||||
when: not freshclampath.stat.exists
|
||||
- name: Create clamd file
|
||||
become: yes
|
||||
become_method: sudo
|
||||
copy:
|
||||
src: clamav/clamav-milter.conf
|
||||
dest: /etc/clamav/clamav-milter.conf
|
||||
force: yes
|
||||
backup: yes
|
||||
when: not freshclampath.stat.exists
|
Reference in New Issue
Block a user