Merge branch 'COOK-668'
This commit is contained in:
commit
0332c34aea
@ -4,6 +4,8 @@ Description
|
|||||||
Installs and configures postfix for client or outbound relayhost, or
|
Installs and configures postfix for client or outbound relayhost, or
|
||||||
to do SASL authentication.
|
to do SASL authentication.
|
||||||
|
|
||||||
|
On RHEL-family systems, sendmail will be replaced with postfix.
|
||||||
|
|
||||||
Requirements
|
Requirements
|
||||||
============
|
============
|
||||||
|
|
||||||
@ -11,6 +13,8 @@ Requirements
|
|||||||
|
|
||||||
* Ubuntu 10.04+
|
* Ubuntu 10.04+
|
||||||
* Debian 6.0+
|
* Debian 6.0+
|
||||||
|
* RHEL/CentOS/Scientific 5.7+, 6.2+
|
||||||
|
* Amazon Linux (as of 4/9/2012)
|
||||||
|
|
||||||
Attributes
|
Attributes
|
||||||
==========
|
==========
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
@ -23,9 +23,23 @@ package "postfix" do
|
|||||||
end
|
end
|
||||||
|
|
||||||
service "postfix" do
|
service "postfix" do
|
||||||
|
supports :status => true, :restart => true, :reload => true
|
||||||
action :enable
|
action :enable
|
||||||
end
|
end
|
||||||
|
|
||||||
|
case node[:platform]
|
||||||
|
when "redhat", "centos", "amazon", "scientific"
|
||||||
|
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
|
||||||
|
|
||||||
%w{main master}.each do |cfg|
|
%w{main master}.each do |cfg|
|
||||||
template "/etc/postfix/#{cfg}.cf" do
|
template "/etc/postfix/#{cfg}.cf" do
|
||||||
source "#{cfg}.cf.erb"
|
source "#{cfg}.cf.erb"
|
||||||
@ -35,3 +49,7 @@ end
|
|||||||
notifies :restart, resources(:service => "postfix")
|
notifies :restart, resources(:service => "postfix")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
service "postfix" do
|
||||||
|
action :start
|
||||||
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user