Files
confdroid_clamav/manifests/params.pp
2026-09-22 13:16:48 +02:00

93 lines
4.2 KiB
ObjectPascal

## confdroid_clamav::params.pp
# Module name: confdroid_clamav
# Author: 12ww1160 (12ww1160@confdroid.com)
# @summary Class holds all parameters for the confdroid_clamav module and is
# inherited by all classes except defines.
# @param [Array] cv_reqpackages List of packages to install.
# @param [String] cv_pkg_ensure
# which [package type](https://confdroid.com/2017/05/puppet-type-package/)
# to choose, i.e. `latest` or `present`.
# @param [String] cv_logfile where to log messages for the clamd service.
# @param [String] cv_logfileunlock whether log file should be locked for
# writing -the lock protects against running clamd multiple times
# @param [String] cv_logfilemaxsize the max size for the logfile. This also
# enables logrotation.
# @param [String] cv_logtime Whether to log the time with each message.
# @param [String] cv_logclean whether to log clean files. Useful in debugging
# but drastically increases the log size.
# @param [String] cv_logsyslog Use system logger (can work together with
# LogFile).
# @param [String] cv_logfacility type of syslog messages - please refer to
# 'man syslog'for facility names
# @param [String] cv_logverbose Whether to log verbose.
# @param [String] cv_logrotate whether to enable log rotation. Always enabled
# when LogFileMaxSize is enabled.
# @param [String] cv_preludeenable whether to enable prelude output.
# @param [String] cv_preludeanalyzername name of the analyzer used by
# prelude-admin.
# @param [String] cv_tcpsocket socket port
# @param [String] cv_tcpaddress ip address to listen on
# @param [String] cv_alert_email email address to send alerts
# @param [String] cv_cron_hour which hour the scan should start
# @param [String] cv_cron_minute which minute the scan should start
# @param [String] cv_cron_user which user should run the cron job
# @param [String] cv_scan_dir which directory should be scanned
# @param [String] cv_alert_file location and name of the alert file
# @param [Boolean] cv_enable_freshclam whether to enable the freshclam service
# @param [Boolean] cv_enable_clamd whether to enable the clamd service
# @param [Boolean] cv_use_excludepaths whether to use advanced exclude paths
##############################################################################
class confdroid_clamav::params (
# installation
Array $cv_reqpackages = ['clamav','clamd','s-nail'],
String $cv_pkg_ensure = 'present',
# clamd
String $cv_logfile = '/var/log/clamd.scan',
String $cv_logfileunlock = 'no',
String $cv_logfilemaxsize = '2M',
String $cv_logtime = 'yes',
String $cv_logclean = 'no',
String $cv_logsyslog = 'yes',
String $cv_logfacility = 'LOG_MAIL',
String $cv_logverbose = 'no',
String $cv_logrotate = 'yes',
String $cv_preludeenable = 'no',
String $cv_preludeanalyzername = 'ClamAV',
String $cv_tcpsocket = '3310',
String $cv_tcpaddress = 'localhost',
String $cv_alert_email = 'you@example.com',
String $cv_cron_hour = '2',
String $cv_cron_minute = '0',
String $cv_cron_user = 'root',
String $cv_scan_dir = '/',
String $cv_alert_file = 'tmp/clamav-alert.txt',
Boolean $cv_enable_freshclam = true,
Boolean $cv_enable_clamd = true,
Boolean $cv_use_excludepaths = true,
String $cv_concurrentdatabasereload = 'no',
) {
# service
$cv_service = 'clamd@scan'
$cv_freshclam = 'freshclam'
# dirs
$cv_config_d_dir = '/etc/clamd.d'
# files
$cv_clamd_config_file = "${cv_config_d_dir}/scan.conf"
$cv_clamd_config_erb = 'confdroid_clamav/scan_conf.erb'
$cv_freshclam_file = '/etc/freshclam.conf'
$cv_freshclam_erb = 'confdroid_clamav/freshclam_conf.erb'
$cv_freshclam_svc = '/usr/lib/systemd/system/freshclam.service'
$cv_freshclam_svc_erb = 'confdroid_clamav/freshclam_svc.erb'
$cv_shell_script = "${cv_config_d_dir}/scan.sh"
$cv_shell_script_erb = 'confdroid_clamav/scan.sh.erb'
# includes must be last
include confdroid_clamav::main::config
}