move files
This commit is contained in:
33
playbooks/managed-mailcow/migrate-clamd.yaml
Normal file
33
playbooks/managed-mailcow/migrate-clamd.yaml
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
|
||||
- name: ClamAV Server auf neuen shared ClamAV setzen
|
||||
hosts: all
|
||||
tasks:
|
||||
- name: "Setze ClamAV Server in rspamd Config auf managed mailcows"
|
||||
ansible.builtin.replace:
|
||||
path: "/opt/mailcow-dockerized/data/conf/rspamd/local.d/antivirus.conf"
|
||||
regexp: "^ servers = \".*\";$"
|
||||
replace: " servers = \"[2a07:6fc0:c:2809::23]:3310\";"
|
||||
backup: yes
|
||||
register: rspamd
|
||||
|
||||
- name: "Setze lokalen ClamAV auf n (falls noch nicht geschehen)"
|
||||
ansible.builtin.replace:
|
||||
path: "/opt/mailcow-dockerized/mailcow.conf"
|
||||
regexp: "^SKIP_CLAMD=.*"
|
||||
replace: "SKIP_CLAMD=y"
|
||||
backup: yes
|
||||
register: clamd
|
||||
|
||||
- name: "Starte mailcow Container neu (wenn ClamAV noch nicht deaktiviert lokal)"
|
||||
ansible.builtin.shell: |
|
||||
cd /opt/mailcow-dockerized
|
||||
docker compose up -d
|
||||
when: clamd.changed
|
||||
|
||||
- name: "Restart Rspamd Container"
|
||||
shell: |
|
||||
cd /opt/mailcow-dockerized
|
||||
docker compose restart rspamd-mailcow
|
||||
when: rspamd.changed
|
||||
|
||||
Reference in New Issue
Block a user