clamav: Initial version of module.
This commit is contained in:
parent
fcf4d9017b
commit
0adb6341d1
1 changed files with 50 additions and 0 deletions
50
clamav/manifests/init.pp
Normal file
50
clamav/manifests/init.pp
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
|
||||||
|
# Install Clam AntiVirus
|
||||||
|
#
|
||||||
|
class clamav {
|
||||||
|
|
||||||
|
package { "clamav":
|
||||||
|
ensure => installed,
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Scan directories periodically
|
||||||
|
#
|
||||||
|
# === Parameters:
|
||||||
|
#
|
||||||
|
# $name:
|
||||||
|
# Directory path to scan.
|
||||||
|
# $hour:
|
||||||
|
# At what hour should scanning occur. Defaults to 4am.
|
||||||
|
# $weekday:
|
||||||
|
# At what day should sacnning occur. For daily scanning you
|
||||||
|
# can use "*". Defaults to Sunday.
|
||||||
|
# $exclude:
|
||||||
|
# Directories matching to this regex will be excluded from
|
||||||
|
# scanning. Default is to scan everything.
|
||||||
|
#
|
||||||
|
# === Sample usage:
|
||||||
|
#
|
||||||
|
# clamav::scan { "/export/roles":
|
||||||
|
# exclude => "/export/roles/[a-z]*/library/archive",
|
||||||
|
# }
|
||||||
|
#
|
||||||
|
define clamav::scan($hour="04", $weekday="Sunday", $exclude=undef) {
|
||||||
|
|
||||||
|
require clamav
|
||||||
|
|
||||||
|
if $exclude {
|
||||||
|
$exclude_opts = "--exclude-dir='${exclude}'"
|
||||||
|
}
|
||||||
|
|
||||||
|
cron { "virusscan-${name}":
|
||||||
|
command => "clamscan -r --infected --no-summary ${name} ${exclude_opts}",
|
||||||
|
user => "root",
|
||||||
|
hour => $hour,
|
||||||
|
minute => "00",
|
||||||
|
weekday => $weekday,
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue