From 6626efcbc5a867856ec038948396677e32bf2993 Mon Sep 17 00:00:00 2001 From: Timo Makinen Date: Fri, 18 Sep 2015 11:37:48 +0300 Subject: [PATCH] clamav: Add support for CentOS/RedHat 7. --- clamav/manifests/init.pp | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/clamav/manifests/init.pp b/clamav/manifests/init.pp index 88c1563..92ae554 100644 --- a/clamav/manifests/init.pp +++ b/clamav/manifests/init.pp @@ -6,15 +6,31 @@ # $update: # Set to false to disable automatic virus database updates. # -class clamav($update="true") { +class clamav($update=true) { package { "clamav": ensure => installed, } - if $update == false { - file { "/etc/cron.daily/freshclam": - ensure => absent, + case $::operatingsystem { + "centos","redhat": { + if (versioncmp($::operatingsystemrelease, 7) < 0) { + if (!$update) { + file { "/etc/cron.daily/freshclam": + ensure => absent, + } + } + } else { + package { "clamav-update": + ensure => $update ? { + true => "present", + false => "absent", + } + } + } + } + default: { + fail("clamav module not supported on ${::operatingsystem}") } }