From de6c111a7200734a491eb3db724981f7739fb35b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Pinson?= <raphael.pinson@camptocamp.com> Date: Mon, 20 May 2013 14:50:02 +0200 Subject: [PATCH] Fix unscoped variables in templates/master.cf.common.erb --- spec/classes/postfix_spec.rb | 11 ++++++++++- templates/master.cf.common.erb | 10 +++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/spec/classes/postfix_spec.rb b/spec/classes/postfix_spec.rb index 9653cdf..3ce287c 100644 --- a/spec/classes/postfix_spec.rb +++ b/spec/classes/postfix_spec.rb @@ -98,7 +98,16 @@ describe 'postfix' do it { should contain_file('/etc/postfix/master.cf').without('seltype').with_content( /smtp inet n - - - - smtpd/ - ) } + ).with_content( + /amavis unix/ + ).with_content( + /dovecot.*\n.* user=bar:bar / + ).with_content( + /schleuder/ + ).with_content( + /sympa/ + ) + } it { should contain_file('/etc/postfix/main.cf').without('seltype') } it { should contain_postfix__config('myorigin') } diff --git a/templates/master.cf.common.erb b/templates/master.cf.common.erb index 6e34c98..ba7806e 100644 --- a/templates/master.cf.common.erb +++ b/templates/master.cf.common.erb @@ -1,4 +1,4 @@ -<% if has_variable?("postfix_use_amavisd") and postfix_use_amavisd == 'yes' %> +<% if scope.lookupvar('postfix::use_amavisd') == 'yes' %> amavis unix - - - - 2 smtp -o smtp_data_done_timeout=1200 -o smtp_send_xforward_command=yes @@ -17,15 +17,15 @@ amavis unix - - - - 2 smtp -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks -o smtpd_bind_address=127.0.0.1 <% end -%> -<% if has_variable?("postfix_use_dovecot_lda") and postfix_use_dovecot_lda == 'yes' %> +<% if scope.lookupvar('postfix::use_dovecot_lda') == 'yes' %> dovecot unix - n n - - pipe - flags=DRhu user=<%= postfix_mail_user %>:<%= postfix_mail_user %> argv=/usr/lib/dovecot/deliver -d ${recipient} + flags=DRhu user=<%= scope.lookupvar('postfix::mail_user') %>:<%= scope.lookupvar('postfix::mail_user') %> argv=/usr/lib/dovecot/deliver -d ${recipient} <% end -%> -<% if has_variable?("postfix_use_schleuder") and postfix_use_schleuder == 'yes' %> +<% if scope.lookupvar('postfix::use_schleuder') == 'yes' %> schleuder unix - n n - - pipe flags=DRhu user=schleuder argv=/usr/bin/schleuder ${user} <% end -%> -<% if has_variable?("postfix_use_sympa") and postfix_use_sympa == 'yes' %> +<% if scope.lookupvar('postfix::use_sympa') == 'yes' %> sympa unix - n n - - pipe flags=R user=sympa argv=/usr/lib/sympa/bin/queue ${recipient} sympabounce unix - n n - - pipe -- GitLab