robertdebock.clamav

Ansible Role ClamAV

This guide helps you install and set up ClamAV on your system.

GitHub GitLab Downloads Version
GitHub GitLab Downloads Version

Example Playbook

Here’s a simple example from molecule/default/converge.yml. It runs a test every time there’s a code change.

---
- name: Converge
  hosts: all
  become: true
  gather_facts: true

  roles:
    - role: robertdebock.clamav
      freshclam_private_mirrors:
        - https://www.danami.com/hotfix/clamav

Before running this, the machine needs to be prepared. In CI, this is done using molecule/default/prepare.yml:

---
- name: Prepare
  hosts: all
  become: true
  gather_facts: false

  roles:
    - role: robertdebock.bootstrap
    - role: robertdebock.epel

For a full explanation on using these roles, check out the detailed guide.

Role Variables

You can find the default variable settings in defaults/main.yml:

---
# default settings for clamav

# If you use SELinux, configure it to allow scanning.
clamav_can_scan_system: true

# Customize parameters with "regexp" and "line". "regexp" specifies the line to replace, and "line" is the new content.
clamav_configuration:
  - line: "Example"
    state: absent
  - line: "TCPSocket 10025"
  - line: "TCPAddr 127.0.0.1"
  - line: "LogFile /var/log/clamd.scan"

# To use local clamav mirrors, define them here:
# freshclam_private_mirrors:
#   - mirror1.mynetwork.com
#   - mirror2.mynetwork.com

Requirements

Make sure you have the pip packages listed in requirements.txt.

State of Used Roles

The following roles help set up your system. You can choose other methods as well.

Requirement GitHub GitLab
robertdebock.bootstrap Build Status GitHub Build Status GitLab
robertdebock.epel Build Status GitHub Build Status GitLab

Context

This role belongs to a group of compatible roles. For more details, visit the documentation of these roles.

Here’s an overview of related roles: dependencies

Compatibility

This role has been tested with the following container images:

Container Tags
Alpine all
Amazon Candidate
EL 9
Debian all
Fedora all
Ubuntu all

You need at least Ansible version 2.12. Tests have been done on previous, current, and development versions.

If you encounter issues, please report them on GitHub.

License

This role is licensed under the Apache-2.0.

Author Information

This role was created by Robert Debock.

If you’d like to support me, please consider sponsoring me.

Informazioni sul progetto

Install and configure clamav on your system.

Installa
ansible-galaxy install robertdebock.clamav
Licenza
apache-2.0
Download
1.5k
Proprietario
I know my way around (Linux) infrastructure, have a passion for automation, Docker, Ansible, Molecule and ci/cd.