Select Git revision
remove_packages.yml
remove_packages.yml 1.19 KiB
---
### PAKETDEINSTALLATIONEN ###
- name: clamav entfernen
block:
- name: clamav Prüfung
#command: systemctl list-unit-files | grep clam
command: systemctl list-unit-files clamav-daemon.service clamav-freshclam.service
register: check_clamav_installed
failed_when:
- ( "0 unit files listed." not in check_clamav_installed.stdout )
- ( check_clamav_installed.rc != 0 )
changed_when:
- ( "0 unit files listed." not in check_clamav_installed.stdout )
- ( check_clamav_installed.rc != 0 )
- name: clamav Deinstallation
block:
- name: clamav systemd Services deaktivieren
systemd:
name: "{{ item }}"
enabled: false
state: stopped
loop:
- 'clamav-daemon.service'
- 'clamav-freshclam.service'
ignore_errors: "yes"
- name: clamav Pakete deinstallieren
apt:
name:
- 'clamav'
- 'clamav-base'
- 'clamav-freshclam'
state: absent
purge: true
autoremove: yes
when:
- ( "0 unit files listed." not in check_clamav_installed.stdout )