procmail: Support OpenBSD, add content parameter for procmail::rc
This commit is contained in:
parent
3ae7a48fe9
commit
0b7dca59d3
1 changed files with 29 additions and 11 deletions
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
# Install procmail
|
# Install procmail
|
||||||
#
|
#
|
||||||
class procmail {
|
class procmail {
|
||||||
|
@ -14,7 +13,10 @@ class procmail {
|
||||||
recurse => true,
|
recurse => true,
|
||||||
mode => "0755",
|
mode => "0755",
|
||||||
owner => "root",
|
owner => "root",
|
||||||
group => "root",
|
group => $::operatingsystem ? {
|
||||||
|
"openbsd" => "wheel",
|
||||||
|
default => "root",
|
||||||
|
},
|
||||||
source => "puppet:///modules/custom/empty",
|
source => "puppet:///modules/custom/empty",
|
||||||
require => Package["procmail"],
|
require => Package["procmail"],
|
||||||
notify => Exec["generate-procmailrc"],
|
notify => Exec["generate-procmailrc"],
|
||||||
|
@ -24,7 +26,10 @@ class procmail {
|
||||||
ensure => present,
|
ensure => present,
|
||||||
mode => "0644",
|
mode => "0644",
|
||||||
owner => "root",
|
owner => "root",
|
||||||
group => "root",
|
group => $::operatingsystem ? {
|
||||||
|
"openbsd" => "wheel",
|
||||||
|
default => "root",
|
||||||
|
},
|
||||||
require => Package["procmail"],
|
require => Package["procmail"],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,6 +41,7 @@ class procmail {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Add config file to procmail
|
# Add config file to procmail
|
||||||
#
|
#
|
||||||
# === Parameters
|
# === Parameters
|
||||||
|
@ -44,6 +50,8 @@ class procmail {
|
||||||
# Config file name.
|
# Config file name.
|
||||||
# $source:
|
# $source:
|
||||||
# Config file source. Defaults to "puppet:///files/procmail/$name".
|
# Config file source. Defaults to "puppet:///files/procmail/$name".
|
||||||
|
# $content:
|
||||||
|
# Config file content.
|
||||||
#
|
#
|
||||||
# === Sample usage
|
# === Sample usage
|
||||||
#
|
#
|
||||||
|
@ -51,17 +59,27 @@ class procmail {
|
||||||
# source => "/etc/mail/spamassassin/spamassassin-spamc.rc",
|
# 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}":
|
file { "/etc/procmailrc.d/${name}":
|
||||||
ensure => present,
|
ensure => present,
|
||||||
source => $source ? {
|
|
||||||
"AUTO" => "puppet:///files/procmail/${name}",
|
|
||||||
default => $source,
|
|
||||||
},
|
|
||||||
mode => "0644",
|
mode => "0644",
|
||||||
owner => root,
|
owner => "root",
|
||||||
group => root,
|
group => $::operatingsystem ? {
|
||||||
|
"openbsd" => "wheel",
|
||||||
|
default => "root",
|
||||||
|
},
|
||||||
|
content => $content,
|
||||||
|
source => $source_real,
|
||||||
notify => Exec["generate-procmailrc"],
|
notify => Exec["generate-procmailrc"],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue