geerlingguy / ansible-role-clamav

Ansible Role - ClamAV.
https://galaxy.ansible.com/geerlingguy/clamav/
MIT License
60 stars 51 forks source link

Debian/Ubuntu: Fix location of freshclam.conf #34

Closed fkleon closed 2 months ago

fkleon commented 2 months ago

On Ubuntu, when trying to apply any freshclam config updates via clamav_freshclam_configuration_changes, I'm seeing the following error:

TASK [geerlingguy.clamav : Change configuration for the freshclam daemon.] *****

Wednesday 31 July 2024 13:43:47 +1200 (0:00:01.291) 0:04:59.151 ****

failed: [default] (item={'regexp': '^.TestDatabases .$', 'line': 'TestDatabases False'}) => {"ansible_loop_var": "item", "changed": false, "item": {"line": "TestDatabases False", "regexp": "^.TestDatabases .$"}, "msg": "Destination /etc/freshclam.conf does not exist !", "rc": 257}

After investigating the issue, I think the default freshclam config path set in this role is incorrect.

For Debian/Ubuntu, as far as I can tell, the freshclam config file was never located at /etc/freshclam.conf, but instead is at /etc/clamav/freshclam.conf.

Here is the relevant documentation for the oldest supported OS releases by this role, confirming the correct location to be /etc/clamav/freshclam.conf:

fkleon commented 2 months ago

@geerlingguy Any chance you could have a look at this? It's a very small change.

fkleon commented 2 months ago

@geerlingguy Thank you :smile: