From 0b7dca59d312c7dc280a3ff0bfaf0fb808b15883 Mon Sep 17 00:00:00 2001 From: Ossi Salmi Date: Sun, 28 Jul 2013 20:16:00 +0300 Subject: [PATCH] procmail: Support OpenBSD, add content parameter for procmail::rc --- procmail/manifests/init.pp | 40 +++++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/procmail/manifests/init.pp b/procmail/manifests/init.pp index d5228bf..e76cc5b 100644 --- a/procmail/manifests/init.pp +++ b/procmail/manifests/init.pp @@ -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,18 +59,28 @@ class procmail { # source => "/etc/mail/spamassassin/spamassassin-spamc.rc", # } # -define procmail::rc($source = "AUTO") { +define procmail::rc($source="AUTO", $content=undef) { - file { "/etc/procmailrc.d/${name}": - ensure => present, - source => $source ? { + if $content { + $source_real = undef + } else { + $source_real = $source ? { "AUTO" => "puppet:///files/procmail/${name}", default => $source, + } + } + + file { "/etc/procmailrc.d/${name}": + ensure => present, + mode => "0644", + owner => "root", + group => $::operatingsystem ? { + "openbsd" => "wheel", + default => "root", }, - mode => "0644", - owner => root, - group => root, - notify => Exec["generate-procmailrc"], + content => $content, + source => $source_real, + notify => Exec["generate-procmailrc"], } }