From: karim hamidou Date: Sat, 28 Sep 2013 10:39:12 +0000 (+0200) Subject: postfix configuration X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=f92522573f9d70f6560f722cc87d64754a46faa9;p=kite.git postfix configuration --- diff --git a/manifests/default.pp b/manifests/default.pp index b8e1b3f..f253248 100644 --- a/manifests/default.pp +++ b/manifests/default.pp @@ -1,5 +1,52 @@ $packages = ["postfix"] +group { "kite": + ensure => "present" +} + +user { "kite": + require => Group["kite"], + ensure => present, + gid => "kite", + shell => "/bin/true", + home => "/home/kite", + managehome => true, +} + +file { "/var/kitemail": + require => User["kite"], + ensure => "directory", + owner => "kite", + group => "kite", +} + package { $packages: ensure => present, } + +service {'postfix': + ensure => running, + enable => true, + hasstatus => true, + hasrestart => true, + require => Package["postfix"] +} + +# code comes from : https://bitbucket.org/daks/puppet-postfix/src/2e93e657cab6/manifests/definitions/config.pp +define postfix_config ($ensure = present, $value, $nonstandard = false) { + exec {"postconf -e ${name}='${value}'": + path => ["/usr/bin/", "/usr/sbin"], + unless => $nonstandard ? { + false => "test \"x$(postconf -h ${name})\" == 'x${value}'", + true => "test \"x$(egrep '^${name} ' /etc/postfix/main.cf | cut -d= -f2 | cut -d' ' -f2)\" == 'x${value}'", + }, + notify => Service["postfix"], + require => Package["postfix"] + } +} + +postfix_config { 'home_mailbox': + value => "Maildir/", +} + +