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}") } }