Skip to content
Snippets Groups Projects
Commit cd0090f0 authored by Raphaël Pinson's avatar Raphaël Pinson
Browse files

Various fixes, add spec for init class

parent 2b796d24
No related branches found
No related tags found
No related merge requests found
class postfix::params { class postfix::params {
case $::osfamily { case $::osfamily {
'RedHat': { 'RedHat': {
$seltype = $::lsbmajdistrelease { $seltype = $::lsbmajdistrelease ? {
'4' => 'etc_t', '4' => 'etc_t',
'5','6' => 'postfix_etc_t', /5|6/ => 'postfix_etc_t',
default => undef, default => undef,
} }
...@@ -13,7 +13,7 @@ class postfix::params { ...@@ -13,7 +13,7 @@ class postfix::params {
} }
'Debian': { 'Debian': {
$seltype = undef, $seltype = undef
$mailx_package = $::lsbdistcodename ? { $mailx_package = $::lsbdistcodename ? {
/sarge|etch|lenny|lucid/ => 'mailx', /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 @@ ...@@ -8,11 +8,11 @@
# (yes) (yes) (yes) (never) (100) # (yes) (yes) (yes) (never) (100)
# ========================================================================== # ==========================================================================
<% if has_variable?('postfix_master_smtp') -%> <% if has_variable?('postfix_master_smtp') -%>
<%= postfix_master_smtp %> <%= @postfix_master_smtp %>
<% elsif postfix_smtp_listen == 'all' -%> <% elsif scope.lookupvar('postfix::smtp_listen') == 'all' -%>
smtp inet n - - - - smtpd smtp inet n - - - - smtpd
<% else -%> <% else -%>
<%= postfix_smtp_listen %>:smtp inet n - - - - smtpd <%= scope.lookupvar('postfix::smtp_listen') %>:smtp inet n - - - - smtpd
<% end -%> <% end -%>
<% if has_variable?('postfix_master_submission') -%> <% if has_variable?('postfix_master_submission') -%>
<%= postfix_master_submission %> <%= postfix_master_submission %>
...@@ -68,7 +68,7 @@ scache unix - - - - 1 scache ...@@ -68,7 +68,7 @@ scache unix - - - - 1 scache
# Also specify in main.cf: maildrop_destination_recipient_limit=1 # Also specify in main.cf: maildrop_destination_recipient_limit=1
# #
maildrop unix - n n - - pipe 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. # See the Postfix UUCP_README file for configuration details.
# #
......
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
# service type private unpriv chroot wakeup maxproc command + args # service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (100) # (yes) (yes) (yes) (never) (100)
# ========================================================================== # ==========================================================================
<% if postfix_smtp_listen == 'all' -%> <% if scope.lookupvar('postfix::smtp_listen') == 'all' -%>
smtp inet n - n - - smtpd smtp inet n - n - - smtpd
<% else -%> <% else -%>
<%= postfix_smtp_listen %>:smtp inet n - n - - smtpd <%= scope.lookupvar('postfix::smtp_listen') %>:smtp inet n - n - - smtpd
<% end -%> <% end -%>
#smtp inet n - n - - smtpd #smtp inet n - n - - smtpd
#submission inet n - n - - smtpd #submission inet n - n - - smtpd
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment