diff options
author | Micah Anderson <micah@riseup.net> | 2011-11-14 11:42:58 -0500 |
---|---|---|
committer | Micah Anderson <micah@riseup.net> | 2011-11-14 11:42:58 -0500 |
commit | 5226583c8c6ecd74d0621b2b61e56ab9f98bcb6c (patch) | |
tree | 91cb5aa98fe5c25a8d381aaff14db76efc8162c4 /manifests/config | |
parent | 4694e77991dadf1bcc54fd9ff5b7651fcc6fc87d (diff) |
allow for overriding the owner/group/mode of dovecot config files
In some cases, the default permissions will not work. For example, if you are
using postfix's pipe to send things through dovecot's LDA with sieve for
filtering, you will get this:
dovecot-lda: Permission denied doveconf: Fatal: Error in configuration file /etc/dovecot/dovecot.conf line 17: Couldn't open include file /etc/dovecot/conf.d/90-sieve.conf: Permission denied
that is because, by default, the process runs as user 'mail'
Diffstat (limited to 'manifests/config')
-rw-r--r-- | manifests/config/file.pp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/manifests/config/file.pp b/manifests/config/file.pp index fe93500..39c6cc3 100644 --- a/manifests/config/file.pp +++ b/manifests/config/file.pp @@ -2,7 +2,10 @@ define dovecot::config::file ( $ensure = present, $source = 'absent', $content = 'absent', - $destination = 'absent' + $destination = 'absent', + $mode = 'absent', + $owner = 'absent', + $group = 'absent' ) { @@ -15,13 +18,28 @@ define dovecot::config::file ( default => $destination } + $real_mode = $mode ? { + 'absent' => 0640, + default => $mode + } + + $real_owner = $owner ? { + 'absent' => root, + default => $owner + } + + $real_group = $group ? { + 'absent' => 0, + default => $group + } + # the $name variable is set to dovecot_${name}, but the actual filename will # be set to $name file { "dovecot_${name}": ensure => $ensure, path => $real_destination, notify => Service[dovecot], - owner => root, group => 0, mode => 0640; + owner => $real_owner, group => $real_group, mode => $real_mode; } # the $content variable is 'absent' by default, so if the user doesn't |