Puppet Class: clamav
- Defined in:
- manifests/init.pp
Overview
Class: clamav
Install clamav
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'manifests/init.pp', line 5
class clamav (
$whitelist_sig = [],
$whitelist_sha = [],
$whitelist_md5 = [],
) {
include clamav::package
include clamav::params
validate_array($whitelist_sig)
validate_array($whitelist_sha)
validate_array($whitelist_md5)
$whitelist_sig_count = count($whitelist_sig)
$whitelist_sha_count = count($whitelist_sha)
$whitelist_md5_count = count($whitelist_md5)
$whitelist_sig_ensure = $whitelist_sig_count ? {
0 => absent,
default => file,
}
$whitelist_sha_ensure = $whitelist_sha_count ? {
0 => absent,
default => file,
}
$whitelist_md5_ensure = $whitelist_md5_count ? {
0 => absent,
default => file,
}
File {
owner => $clamav::params::user,
group => $clamav::params::user,
require => Class['clamav::package'],
}
file { [ '/etc/clamav', '/etc/clamav/scans' ]:
ensure => directory,
}
file { '/var/lib/clamav/local.ign2':
ensure => $whitelist_sig_ensure,
content => template('clamav/whitelist.ign2.erb')
}
file { '/var/lib/clamav/local.sfp':
ensure => $whitelist_sha_ensure,
content => template('clamav/whitelist.sfp.erb')
}
file { '/var/lib/clamav/local.fp':
ensure => $whitelist_md5_ensure,
content => template('clamav/whitelist.fp.erb')
}
}
|