Created
April 19, 2013 15:29
-
-
Save midacts/5421103 to your computer and use it in GitHub Desktop.
clamav::database
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class clamav::database { | |
require clamav::params | |
# Copies the main.cvd files to the node's local clamav database directory | |
file { 'main_cvd': | |
ensure => file, | |
path => "${clamav::params::main_origin}", | |
source => 'puppet:///modules/clamav/main.cvd', | |
mode => 644, | |
owner => clamav, | |
group => clamav, | |
require => Package['clamav'], | |
} | |
# Copies the daily.cvd files to the node's local clamav database directory | |
file { 'daily_cvd': | |
ensure => file, | |
path => "${clamav::params::daily_origin}", | |
source => 'puppet:///modules/clamav/daily.cvd', | |
mode => 644, | |
owner => clamav, | |
group => clamav, | |
require => Package['clamav'], | |
} | |
} | |
class clamav::params { | |
# Database file variables | |
$daily_origin = '/var/lib/clamav/daily.cvd' | |
$daily_file = '/etc/puppetlabs/puppet/modules/clamav/files/daily.cvd' | |
$main_origin = '/var/lib/clamav/main.cvd' | |
$main_file = '/etc/puppetlabs/puppet/modules/clamav/files/main.cvd' | |
# Database lcation variable | |
$databasedirectory = "/var/lib/clamav" | |
# Date used for the clamscan.log variable | |
$date = inline_template("<%= Time.now.strftime('%m%d%Y') %>") | |
# Clamscan.log location and name variable | |
$clamscan_log = "/var/log/clamav/${date}_clamav.log" | |
# hour variable used for clamscan cron job | |
$hour = '4' | |
# minute variable usef for clamscan cron job | |
$minute = '0' | |
# Case to hand out variables based on the operating system | |
case $::operatingsystem { | |
centos, opensuse: { | |
$clamd_file = "/etc/clamd.conf" | |
$freshclam_file = "/etc/freshclam.conf" | |
$freshclam_srv = "clamav-freshclam" | |
} | |
debian, ubuntu: { | |
$clamd_file = "/etc/clamav/clamd.conf" | |
$freshclam_file = "/etc/clamav/freshclam.conf" | |
$freshclam_srv = "clamav-freshclam" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment