[COOK-3328] Refactor main.cf template and attributes
Signed-off-by: Seth Vargo <sethvargo@gmail.com>
This commit is contained in:
committed by
Seth Vargo
parent
3d18ce0e39
commit
0108248ac4
@@ -21,12 +21,9 @@
|
||||
package "postfix"
|
||||
|
||||
if node['postfix']['use_procmail']
|
||||
|
||||
package "procmail"
|
||||
|
||||
end
|
||||
|
||||
|
||||
service "postfix" do
|
||||
supports :status => true, :restart => true, :reload => true
|
||||
action :enable
|
||||
@@ -34,7 +31,6 @@ end
|
||||
|
||||
case node['platform_family']
|
||||
when "rhel", "fedora"
|
||||
|
||||
service "sendmail" do
|
||||
action :nothing
|
||||
end
|
||||
@@ -45,18 +41,17 @@ when "rhel", "fedora"
|
||||
notifies :start, "service[postfix]"
|
||||
not_if "/usr/bin/test /etc/alternatives/mta -ef /usr/sbin/sendmail.postfix"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
%w{main master}.each do |cfg|
|
||||
|
||||
template "/etc/postfix/#{cfg}.cf" do
|
||||
source "#{cfg}.cf.erb"
|
||||
owner "root"
|
||||
group 0
|
||||
mode 00644
|
||||
notifies :restart, "service[postfix]"
|
||||
|
||||
variables(:settings => node['postfix'][cfg])
|
||||
cookbook node['postfix']["#{cfg}_template_source"]
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -55,4 +55,5 @@ template "/etc/postfix/sasl_passwd" do
|
||||
mode 0400
|
||||
notifies :run, "execute[postmap-sasl_passwd]", :immediately
|
||||
notifies :restart, "service[postfix]"
|
||||
variables(:settings => node['postfix']['sasl'])
|
||||
end
|
||||
|
||||
@@ -19,5 +19,6 @@
|
||||
#
|
||||
|
||||
node.override['postfix']['mail_type'] = 'master'
|
||||
node.override['postfix']['main']['inet_interfaces'] = 'all'
|
||||
|
||||
include_recipe "postfix"
|
||||
|
||||
Reference in New Issue
Block a user