Commit cd0090f0 authored by Raphaël Pinson's avatar Raphaël Pinson
Browse files

Various fixes, add spec for init class

parent 2b796d24
class postfix::params {
case $::osfamily {
'RedHat': {
$seltype = $::lsbmajdistrelease {
'4' => 'etc_t',
'5','6' => 'postfix_etc_t',
$seltype = $::lsbmajdistrelease ? {
'4' => 'etc_t',
/5|6/ => 'postfix_etc_t',
default => undef,
}
......@@ -13,7 +13,7 @@ class postfix::params {
}
'Debian': {
$seltype = undef,
$seltype = undef
$mailx_package = $::lsbdistcodename ? {
/sarge|etch|lenny|lucid/ => 'mailx',
......
--format
s
--colour
--loadby
mtime
--backtrace
require 'spec_helper'
describe 'postfix' do
context 'when on Debian' do
let (:facts) { {
:operatingsystem => 'Debian',
:osfamily => 'Debian',
} }
it { should contain_package('postfix') }
end
context 'when on RedHat' do
let (:facts) { {
:operatingsystem => 'RedHat',
:osfamily => 'RedHat',
} }
it { should contain_package('postfix') }
end
end
require 'mocha'
require 'rspec-puppet'
require 'puppetlabs_spec_helper/module_spec_helper'
......@@ -8,11 +8,11 @@
# (yes) (yes) (yes) (never) (100)
# ==========================================================================
<% if has_variable?('postfix_master_smtp') -%>
<%= postfix_master_smtp %>
<% elsif postfix_smtp_listen == 'all' -%>
<%= @postfix_master_smtp %>
<% elsif scope.lookupvar('postfix::smtp_listen') == 'all' -%>
smtp inet n - - - - smtpd
<% else -%>
<%= postfix_smtp_listen %>:smtp inet n - - - - smtpd
<%= scope.lookupvar('postfix::smtp_listen') %>:smtp inet n - - - - smtpd
<% end -%>
<% if has_variable?('postfix_master_submission') -%>
<%= postfix_master_submission %>
......@@ -68,7 +68,7 @@ scache unix - - - - 1 scache
# Also specify in main.cf: maildrop_destination_recipient_limit=1
#
maildrop unix - n n - - pipe
flags=DRhu user=<%= postfix_mail_user %> argv=/usr/bin/maildrop -d ${recipient}
flags=DRhu user=<%= scope.lookupvar('postfix::mail_user') %> argv=/usr/bin/maildrop -d ${recipient}
#
# See the Postfix UUCP_README file for configuration details.
#
......
......@@ -7,10 +7,10 @@
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (100)
# ==========================================================================
<% if postfix_smtp_listen == 'all' -%>
<% if scope.lookupvar('postfix::smtp_listen') == 'all' -%>
smtp inet n - n - - smtpd
<% else -%>
<%= postfix_smtp_listen %>:smtp inet n - n - - smtpd
<%= scope.lookupvar('postfix::smtp_listen') %>:smtp inet n - n - - smtpd
<% end -%>
#smtp inet n - n - - smtpd
#submission inet n - n - - smtpd
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment