geerlingguy.clamav

Ansible 角色:ClamAV

CI

在 RedHat/CentOS 和 Debian/Ubuntu Linux 服务器上安装 ClamAV。

需求

无。

角色变量

以下是可用的变量及其默认值(见 defaults/main.yml):

clamav_packages:
  - clamav
  - clamav-base
  - clamav-daemon

(展示的是 Debian/Ubuntu 的默认值)。要为 ClamAV 操作安装的软件包列表。

clamav_daemon_localsocket: /var/run/clamav/clamd.ctl
clamav_daemon_config_path: /etc/clamav/clamd.conf
clamav_freshclam_daemon_config_path: /etc/clamav/freshclam.conf

ClamAV 守护进程的路径配置。这些路径是针对每个操作系统家族(Debian 和 Red Hat)硬编码的,无法覆盖。

clamav_daemon_configuration_changes:
  - regexp: '^.*Example$'
    state: absent
  - regexp: '^.*LocalSocket .*$'
    line: 'LocalSocket {{ clamav_daemon_localsocket }}'

需要对 ClamAV 启动时读取的配置文件所做的更改。您需要至少注释掉“Example”这一行,并打开一个 LocalSocket(或 TCPSocket,例如默认的 3310),以使 ClamAV 守护进程运行。

clamav_daemon_state: started
clamav_daemon_enabled: true

控制 clamav-daemon 服务是否正在运行和/或在系统启动时启用。

clamav_freshclam_configuration_changes:
  - regexp: '^.*HTTPProxyServer .*$'
    line: 'HTTPProxyServer {{ clamav_freshclam_http_proxy_server }}'
  - regexp: '^.*HTTPProxyPort .*$'
    line: 'HTTPProxyPort {{ clamav_freshclam_http_proxy_port }}'

需要对 freshclam 启动时读取的配置文件所做的更改。如果您有 HTTP 代理服务器,请在此处添加配置。

clamav_freshclam_daemon_state: started
clamav_freshclam_daemon_enabled: true

控制 clamav-freshclam 服务是否正在运行和/或在系统启动时启用。

依赖

无。

示例剧本

- hosts: servers
  become: true
  roles:
    - geerlingguy.clamav

许可证

MIT / BSD

作者信息

此角色由 Jeff Geerling 于 2017 年创建,他是 Ansible for DevOps 的作者。

关于项目

ClamAV installation and configuration.

安装
ansible-galaxy install geerlingguy.clamav
许可证
mit
下载
467k
拥有者
Father, author, developer, maker. Sometimes called "an inflammatory enigma". #stl #drupal #ansible #k8s #raspberrypi #crohns