diff --git a/manifests/main/dirs.pp b/manifests/main/dirs.pp index 835926a..9a29f59 100644 --- a/manifests/main/dirs.pp +++ b/manifests/main/dirs.pp @@ -26,4 +26,16 @@ class cd_clamav::main::dirs ( require cd_clamav::main::install + # config.d dir + file { $cv_config_d_dir: + ensure => directory, + owner => 'root', + group => 'root', + mode => '0755', + selrange => s0, + selrole => object_r, + seltype => etc_t, + seluser => system_u, + } + } diff --git a/manifests/main/files.pp b/manifests/main/files.pp index 29a63e2..e91356f 100644 --- a/manifests/main/files.pp +++ b/manifests/main/files.pp @@ -26,5 +26,31 @@ class cd_clamav::main::files ( require cd_clamav::main::dirs + # clamd config file + file { $cv_clamd_config_file: + ensure => file, + owner => 'root', + group => 'root', + mode => '0644', + selrange => s0, + selrole => object_r, + seltype => etc_t, + seluser => system_u, + content => template($cv_clamd_config_erb), +# notify => Service[$cv_service], + } + + # freshclam config file + file { $cv_freshclam_file: + ensure => file, + owner => 'root', + group => 'root', + mode => '0600', + selrange => s0, + selrole => object_r, + seltype => etc_t, + seluser => system_u, + content => template($cv_freshclam_erb, + } } diff --git a/manifests/params.pp b/manifests/params.pp index 20903ad..1a3180c 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -28,13 +28,22 @@ class cd_clamav::params ( # installation -$reqpackages = ['clamav','clamav-update','clamd'], -$pkg_ensure = 'latest', +$reqpackages = ['clamav','clamav-update','clamd'], +$pkg_ensure = 'present', ) { -$cv_service = '' +# service +$cv_service = 'clamd@.service' +# dirs +$cv_config_d_dir = '/etc/clamd.d' + +# files +$cv_clamd_config_file = "${cv_config_d_dir}/scan.conf" +$cv_clamd_config_erb = 'cd_clamav/scan_conf.erb' +$cv_freshclam_file = '/etc/freshclam.conf' +$cv_freshclam_erb = 'cd_clamav/freshclam_conf.erb' # includes must be last diff --git a/templates/freshclam_conf.erb b/templates/freshclam_conf.erb index 15046ec..70c5f6f 100755 --- a/templates/freshclam_conf.erb +++ b/templates/freshclam_conf.erb @@ -8,7 +8,6 @@ ## Please read the freshclam.conf(5) manual before editing this file. ## - # Comment or remove the line below. #Example