geerlingguy.clamav
Ansible Role: ClamAV
This role installs ClamAV on RedHat/CentOS and Debian/Ubuntu Linux servers.
Requirements
No special requirements.
Role Variables
Here are the available variables and their default values (found in defaults/main.yml
):
clamav_packages
: List of packages to be installed for ClamAV. Defaults for Debian/Ubuntu are:- clamav
- clamav-base
- clamav-daemon
clamav_daemon_localsocket
: Path for the ClamAV daemon socket, set to/var/run/clamav/clamd.ctl
.clamav_daemon_config_path
: Path for the ClamAV daemon configuration file, set to/etc/clamav/clamd.conf
.clamav_freshclam_daemon_config_path
: Path for the freshclam configuration file, set to/etc/clamav/freshclam.conf
.
These paths are fixed for each type of operating system (Debian vs. Red Hat) and cannot be changed.
clamav_daemon_configuration_changes
: List of changes to be made in the ClamAV daemon configuration file, such as commenting out 'Example' and setting up a LocalSocket.clamav_daemon_state
: Determines if theclamav-daemon
service is running (set to 'started').clamav_daemon_enabled
: Indicates if theclamav-daemon
is enabled to start on boot (set to true).clamav_freshclam_configuration_changes
: Changes to be made in the freshclam configuration file, such as adding your HTTP Proxy server details if needed.clamav_freshclam_daemon_state
: Determines if theclamav-freshclam
service is running (set to 'started').clamav_freshclam_daemon_enabled
: Indicates if theclamav-freshclam
is enabled to start on boot (set to true).
Dependencies
No dependencies.
Example Playbook
Here’s an example of how to use this role in a playbook:
- hosts: servers
become: true
roles:
- geerlingguy.clamav
License
MIT / BSD
Author Information
This role was created by Jeff Geerling in 2017, who is the author of Ansible for DevOps.
ClamAV installation and configuration.
ansible-galaxy install geerlingguy.clamav