procmail: Support OpenBSD, add content parameter for procmail::rc

This commit is contained in:
Ossi Salmi 2013-07-28 20:16:00 +03:00
parent 3ae7a48fe9
commit 0b7dca59d3

View file

@ -1,4 +1,3 @@
# Install procmail
#
class procmail {
@ -14,7 +13,10 @@ class procmail {
recurse => true,
mode => "0755",
owner => "root",
group => "root",
group => $::operatingsystem ? {
"openbsd" => "wheel",
default => "root",
},
source => "puppet:///modules/custom/empty",
require => Package["procmail"],
notify => Exec["generate-procmailrc"],
@ -24,7 +26,10 @@ class procmail {
ensure => present,
mode => "0644",
owner => "root",
group => "root",
group => $::operatingsystem ? {
"openbsd" => "wheel",
default => "root",
},
require => Package["procmail"],
}
@ -36,6 +41,7 @@ class procmail {
}
# Add config file to procmail
#
# === Parameters
@ -44,6 +50,8 @@ class procmail {
# Config file name.
# $source:
# Config file source. Defaults to "puppet:///files/procmail/$name".
# $content:
# Config file content.
#
# === Sample usage
#
@ -51,17 +59,27 @@ class procmail {
# source => "/etc/mail/spamassassin/spamassassin-spamc.rc",
# }
#
define procmail::rc($source = "AUTO") {
define procmail::rc($source="AUTO", $content=undef) {
if $content {
$source_real = undef
} else {
$source_real = $source ? {
"AUTO" => "puppet:///files/procmail/${name}",
default => $source,
}
}
file { "/etc/procmailrc.d/${name}":
ensure => present,
source => $source ? {
"AUTO" => "puppet:///files/procmail/${name}",
default => $source,
},
mode => "0644",
owner => root,
group => root,
owner => "root",
group => $::operatingsystem ? {
"openbsd" => "wheel",
default => "root",
},
content => $content,
source => $source_real,
notify => Exec["generate-procmailrc"],
}