Commit 6280a5f6 authored by mh's avatar mh
Browse files

refactor things for >2.7

parent a7df552c
......@@ -7,8 +7,11 @@ For an integration into Postfix and a sample setup, check the README from the Po
Configuration (Debian)
----------------------
$amavis_viruscheck : enables virus checks if true
$amavis_spamcheck : enables spam checks if true
Class parameters
$viruscheck : enables virus checks if true
$spamcheck : enables spam checks if true
Configuration (Debian)
----------------------
......
class amavisd-new::base {
class amavisd_new::base {
#unrar packages for amavis
require unzip
require unrar
......@@ -17,4 +17,4 @@ class amavisd-new::base {
hasstatus => true,
require => Package['amavisd-new'],
}
}
}
class amavisd-new::centos inherits amavisd-new::base {
class amavisd_new::centos inherits amavisd_new::base {
Package['unarj']{
name => 'arj',
}
file{'/etc/amavisd/amavisd.conf':
source => [ "puppet:///modules/site-amavisd-new/${fqdn}/amavisd.conf",
"puppet:///modules/site-amavisd-new/amavisd.conf",
source => [ "puppet:///modules/site_amavisd-new/${::fqdn}/amavisd.conf",
"puppet:///modules/site_amavisd-new/amavisd.conf",
"puppet:///modules/amavisd-new/amavisd.conf" ],
require => Package['amavisd-new'],
notify => Service['amavisd'],
......
class amavisd-new::debian inherits amavisd-new::base {
class amavisd_new::debian inherits amavisd_new::base {
# doesnt exist in debian lenny anymore, is package arj useful ?
Package['unarj']{
ensure => absent,
......@@ -9,7 +9,7 @@ class amavisd-new::debian inherits amavisd-new::base {
}
file {"/etc/amavis/conf.d/50-user":
content => template("amavisd-new/debian/50-user"),
content => template("amavisd_new/debian/50-user"),
require => Package['amavisd-new'],
notify => Service['amavisd'],
owner => root, group => 0, mode => 0644;
......
class amavisd-new::gentoo inherits amavisd-new::base {
class amavisd_new::gentoo inherits amavisd_new::base {
Package['amavisd-new']{
category => 'mail-filter',
}
......
# modules/amavisd-new/manifests/init.pp - manage amavisd-new stuff
# manage amavisd-new stuff
# Copyright (C) 2007 admin@immerda.ch
# GPLv3
# this module is part of a whole bunch of modules, please have a look at the exim module
class amavisd-new {
# defaults
case $amavis_viruscheck { "": { $amavis_viruscheck = "false" } }
case $amavis_spamcheck { "": { $amavis_spamcheck = "false" } }
case $operatingsystem {
gentoo: { include amavisd-new::gentoo }
centos: { include amavisd-new::centos }
class amavisd_new(
$viruscheck = hiera('amavis_viruscheck',false),
$spamcheck = hiera('amavis_spamcheck',false)
) {
case $::operatingsystem {
gentoo: { include amavisd_new::gentoo }
centos: { include amavisd_new::centos }
debian,ubuntu: { include amavisd-new::debian }
default: { include amavisd-new::base }
default: { include amavisd_new::base }
}
if $use_munin {
include amavisd-new::munin
if hiera('use_munin',false) {
include amavisd_new::munin
}
}
class amavisd-new::munin {
class amavisd_new::munin {
munin::plugin::deploy{'amavis_':
source => "amavisd-new/munin/amavis_",
ensure => absent,
}
case $operatingsystem {
case $::operatingsystem {
centos: { $munin_amavis_db_location = '/var/spool/amavisd/db/' }
default: { $munin_amavis_db_location = '/var/lib/amavis/db' }
}
......
......@@ -10,7 +10,7 @@ use strict;
# the directives you can use in this file
#
<% if (amavis_viruscheck == "true" ) -%>
<% if scope.lookupvar('amavis::viruscheck') -%>
# checks viruses
@bypass_virus_checks_maps = (
\%bypass_virus_checks, \@bypass_virus_checks_acl, \$bypass_virus_checks_re);
......@@ -18,7 +18,7 @@ use strict;
# virus checks disabled by puppet
<% end -%>
<% if (amavis_spamcheck == "true" ) -%>
<% if scope.lookupvar('amavis::spamcheck') -%>
# checks for spam
@bypass_spam_checks_maps = (
\%bypass_spam_checks, \@bypass_spam_checks_acl, \$bypass_spam_checks_re);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment