Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion manifests/clamav_milter.pp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
path => $clamav::clamav_milter_config,
mode => '0644',
owner => 'root',
group => 'root',
group => $clamav::root_group,
content => template("${module_name}/clamav.conf.erb"),
}

Expand Down
23 changes: 17 additions & 6 deletions manifests/clamd.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,29 @@

$config_options = $clamav::_clamd_options

package { 'clamd':
ensure => $clamav::clamd_version,
name => $clamav::clamd_package,
before => File['clamd.conf'],
# NOTE: In FreeBSD this is part of the base clamav_package
if $clamav::clamd_package {
package { 'clamd':
ensure => $clamav::clamd_version,
name => $clamav::clamd_package,
before => File['clamd.conf'],
}
$service_subscribe = [
File['clamd.conf'],
Package['clamd'],
]
} else {
$service_subscribe = [
File['clamd.conf'],
]
}

file { 'clamd.conf':
ensure => file,
path => $clamav::clamd_config,
mode => '0644',
owner => 'root',
group => 'root',
group => $clamav::root_group,
content => template("${module_name}/clamav.conf.erb"),
}

Expand All @@ -27,6 +38,6 @@
enable => $clamav::clamd_service_enable,
hasrestart => true,
hasstatus => true,
subscribe => [Package['clamd'], File['clamd.conf']],
subscribe => $service_subscribe,
}
}
6 changes: 3 additions & 3 deletions manifests/freshclam.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
$config_options = $clamav::_freshclam_options
$freshclam_delay = $clamav::freshclam_delay

# NOTE: In RedHat this is part of the base clamav_package
# NOTE: In RedHat and FreeBSD this is part of the base clamav_package
# NOTE: In Debian this is a dependency of the base clamav_package
if $clamav::freshclam_package {
package { 'freshclam':
Expand All @@ -22,7 +22,7 @@
path => $clamav::freshclam_config,
mode => '0644',
owner => 'root',
group => 'root',
group => $clamav::root_group,
content => template("${module_name}/clamav.conf.erb"),
}

Expand All @@ -32,7 +32,7 @@
path => $clamav::freshclam_sysconfig,
mode => '0644',
owner => 'root',
group => 'root',
group => $clamav::root_group,
content => template("${module_name}/sysconfig/freshclam.erb"),
}

Expand Down
1 change: 1 addition & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
Stdlib::Absolutepath $shell = $clamav::params::shell,
$group = $clamav::params::group,
$groups = $clamav::params::groups,
$root_group = $clamav::params::root_group,

String $clamd_package = $clamav::params::clamd_package,
String $clamd_version = $clamav::params::clamd_version,
Expand Down
55 changes: 55 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
$manage_repo = true
$clamav_package = 'clamav'
$clamav_version = 'installed'
$root_group = 'root'

if versioncmp($::operatingsystemmajrelease, '7') >= 0 {
# ### user vars ####
Expand Down Expand Up @@ -135,6 +136,7 @@
$manage_repo = false
$clamav_package = 'clamav'
$clamav_version = 'installed'
$root_group = 'root'

# ### user vars ####
$user = 'clamav'
Expand Down Expand Up @@ -182,6 +184,59 @@
$freshclam_default_pidfile = '/var/run/clamav/freshclam.pid'
$freshclam_default_updatelogfile = '/var/log/clamav/freshclam.log'

} elsif ($::osfamily == 'FreeBSD') {
#### init vars ####
$manage_repo = false
$clamav_package = 'clamav'
$clamav_version = 'installed'
$root_group = 'wheel'

#### user vars ####
$user = 'clamav'
$comment = undef
$uid = 106
$gid = 106
$home = '/var/db/clamav'
$shell = '/usr/sbin/nologin'
$group = 'clamav'
$groups = undef

#### clamd vars ####
$clamd_package = undef
$clamd_version = undef
$clamd_config = '/usr/local/etc/clamd.conf'
$clamd_service = 'clamav-clamd'
$clamd_options = {}

#### freshclam vars ####
$freshclam_package = undef
$freshclam_version = undef
$freshclam_config = '/usr/local/etc/freshclam.conf'
$freshclam_service = 'clamav-freshclam'
$freshclam_options = {}
$freshclam_sysconfig = undef
$freshclam_delay = undef

#### clamav_milter vars ####
$clamav_milter_package = undef
$clamav_milter_version = undef
$clamav_milter_config = undef
$clamav_milter_service = undef
$clamav_milter_options = undef
$clamav_milter_default_options = undef

#### Default values OS specific ####
$clamd_default_databasedirectory = '/var/db/clamav'
$clamd_default_localsocket = '/var/run/clamav/clamd.sock'
$clamd_default_logfile = '/var/log/clamav/clamd.log'
$clamd_default_logrotate = true
$clamd_default_logsyslog = false
$clamd_default_pidfile = '/var/run/clamav/clamd.pid'
$clamd_default_temporarydirectory = '/tmp'
$freshclam_default_databaseowner = $user
$freshclam_default_pidfile = '/var/run/clamav/freshclam.pid'
$freshclam_default_updatelogfile = '/var/log/clamav/freshclam.log'

} else {
fail("The ${module_name} module is not supported on a ${::osfamily} based system with version ${::operatingsystemrelease}.")
}
Expand Down
3 changes: 3 additions & 0 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@
"14.04",
"16.04"
]
},
{
"operatingsystem": "FreeBSD"
}
],
"requirements": [
Expand Down