Added RedHat/CentOS support to postfix cookbook

Signed-off-by: jtimberman <joshua@opscode.com>
This commit is contained in:
Adam Mielke 2012-02-13 16:51:25 -06:00 committed by jtimberman
parent a2c0c7c6f5
commit 002bcb8029
2 changed files with 19 additions and 3 deletions

View File

@ -6,7 +6,7 @@ version "0.8.4"
recipe "postfix", "Installs and configures postfix" recipe "postfix", "Installs and configures postfix"
recipe "postfix::sasl_auth", "Set up postfix to auth to a server with sasl" recipe "postfix::sasl_auth", "Set up postfix to auth to a server with sasl"
%w{ubuntu debian}.each do |os| %w{ubuntu debian redhat centos}.each do |os|
supports os supports os
end end

View File

@ -22,8 +22,24 @@ package "postfix" do
action :install action :install
end end
service "postfix" do case node[:platform]
when "ubuntu", "debian"
service "postfix" do
action :enable action :enable
end
when "redhat", "centos"
service "postfix" do
action :nothing
end
service "sendmail" do
action :nothing
end
execute "switch_mailer_to_postfix" do
command "/usr/sbin/alternatives --set mta /usr/sbin/sendmail.postfix"
notifies :stop, resources(:service => "sendmail")
notifies :start, resources(:service => "postfix")
not_if "/usr/bin/test /etc/alternatives/mta -ef /usr/sbin/sendmail.postfix"
end
end end
%w{main master}.each do |cfg| %w{main master}.each do |cfg|