clamav: Fix clamav::daemon for CentOS/RedHat 7
This commit is contained in:
parent
6626efcbc5
commit
6db1ca7175
1 changed files with 38 additions and 2 deletions
|
@ -43,13 +43,49 @@ class clamav::daemon {
|
||||||
|
|
||||||
require clamav
|
require clamav
|
||||||
|
|
||||||
|
case $::operatingsystem {
|
||||||
|
"centos","redhat": {
|
||||||
|
if (versioncmp($::operatingsystemrelease, 7) < 0) {
|
||||||
|
$package = "clamd"
|
||||||
|
$service = "clamd"
|
||||||
|
} else {
|
||||||
|
$package = "clamav-scanner-systemd"
|
||||||
|
$service = "clamd@scan"
|
||||||
|
exec { "sed -i 's/^Example$/#Example/' /etc/clamd.d/scan.conf":
|
||||||
|
path => "/bin:/usr/bin:/sbin:/usr/sbin",
|
||||||
|
user => "root",
|
||||||
|
onlyif => "egrep '^Example$' /etc/clamd.d/scan.conf",
|
||||||
|
require => Package["clamd"],
|
||||||
|
notify => Service["clamd"],
|
||||||
|
}
|
||||||
|
exec { "sed -i 's/^#LocalSocket /LocalSocket /' /etc/clamd.d/scan.conf":
|
||||||
|
path => "/bin:/usr/bin:/sbin:/usr/sbin",
|
||||||
|
user => "root",
|
||||||
|
onlyif => "egrep '#LocalSocket ' /etc/clamd.d/scan.conf",
|
||||||
|
require => Package["clamd"],
|
||||||
|
notify => Service["clamd"],
|
||||||
|
}
|
||||||
|
file { "/etc/clamd.conf":
|
||||||
|
ensure => link,
|
||||||
|
target => "/etc/clamd.d/scan.conf",
|
||||||
|
owner => "root",
|
||||||
|
group => "root",
|
||||||
|
require => Package["clamd"],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
package { "clamd":
|
package { "clamd":
|
||||||
ensure => installed,
|
ensure => installed,
|
||||||
|
name => $package,
|
||||||
}
|
}
|
||||||
|
|
||||||
service { "clamd":
|
service { "clamd":
|
||||||
ensure => running,
|
ensure => running,
|
||||||
enable => true,
|
name => $service,
|
||||||
|
enable => true,
|
||||||
|
require => Package["clamd"],
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue