Add ClamAV virusfilter support for Samba configuration and installation

This commit is contained in:
2026-05-25 19:41:23 +02:00
parent 7c35a51a9b
commit 723b686c84
3 changed files with 84 additions and 7 deletions
+31
View File
@@ -13,6 +13,37 @@
tags:
- samba-server
# ---
# Virusfilter (ClamAV) — only when at least one share has vfs_object_virusfilter: true
# ---
- name: (samba-install.yml) Ensure virusfilter (ClamAV) packages are installed
package:
pkg: '{{ apt_install_server_samba_virusfilter }}'
state: present
when:
- "groups['samba_server']|string is search(inventory_hostname)"
- samba_shares | selectattr('vfs_object_virusfilter', 'defined') | selectattr('vfs_object_virusfilter', 'equalto', true) | list | length > 0
tags:
- samba-server
- samba-virusfilter
- name: (samba-install.yml) Ensure quarantine directory exists
file:
path: /data/samba/QUARANTINE
owner: root
group: root
mode: '0750'
state: directory
when:
- "groups['samba_server']|string is search(inventory_hostname)"
- samba_shares | selectattr('vfs_object_virusfilter', 'defined') | selectattr('vfs_object_virusfilter', 'equalto', true) | list | length > 0
tags:
- samba-server
- samba-virusfilter
- name: (samba-install.yml) Ensure samba share directories exists
file:
path: "{{ item.path }}"